Lagrange Interpolation related problem (plotting a graph)
x = input('Enter values of x: '); y = input('Enter values of y: '); n = length(x); L = zeros(n,n); for i = 1:n V= 1; ...

22 days ago | 0

Trapezoidal numerical integration without use of function?
a=0; b=1; f=@(x)x.*sin(x); n=100; x=linspace(a,b,n+1); h=(b-a)/n; qt=sum(h*(f(x(1:n))+f(x(2:n+1)))/2) You did not use...

22 days ago | 0

Not enough input Arguments
T = ones(1,3) ;% define as here Td = ones(1,3) ; e = angle_axis(T,Td) % now call You are trying to input a 6 x 6 matri...

22 days ago | 0

Plot two functions with several changing variables
p = 80; m = 10; n = 1:1:10; g = 9.81; N = 11; Lext = linspace(68,80,length(n)); L = 68; k = -(p.*g + m.*g - n.*(m.*g) -...

23 days ago | 0

Convolute ramp signal and step signal
x = 1:1:10 ; p = linspace(0.1,1,length(x)); u = ones(1 , length(x)); r = p.*u; y = conv(r,u,'same'); plot(x,y); Try us...

24 days ago | 1

| accepted

struggling with error in code
clear all close all clc Vo = linspace(5,25,41); lambda = 7.5; beta=(0:0.5:8); r=27.46; R = 30.56; B = 3; rho = 1.225...

25 days ago | 0

hello i want to create a table by using the value i obtained from a for loop, how can i get it
x=5 y=30 I = 1 for z=[1 2 4 8] a(I)=x*y*z; xx(I) = x;yy(I) = y; I = I+1; end iwant = table(xx.',yy.',a.','VariableName...

25 days ago | 0

| accepted

Replace variable to values
syms s ans = 1/s subs(ans,s,7)

26 days ago | 0

How to solve a system of equations symbolically? (MATLAB R2011a)
syms x1 x2 x3 X1 X2 X3 t S = solve([x1- 3*t*X1+X2==0, x2 - 2*t^2*X2 ==0, x3 - 5*t*X3 == 0], [X1 X2 X3]) S = [S.X1 S.X2 S.X3]...

26 days ago | 0

Plotting 2 Semi Circles
th = -pi:pi/50:0;r = 2; xunit = r * cos(pi/2 +th) + 3; yunit = r * sin(pi/2+ th) + 3; plot(xunit,yunit,'-b'); hold on ; li...

27 days ago | 0

How to arrange with the graph
clc; clear; K_t=750; K_r=250; b=5; f_z=0.1; theta=0:360 ; for i = 1: length(theta) if (theta(i) >= 60 & theta(i...

27 days ago | 0

| accepted

Use of sampletime in a constant block simulink
The sampletime is used commonly used in signal processing, controller tuning for establishing a desired data quality measured by...

28 days ago | 0

Error using gcm?
ax = axesm('MapProjection','eqdcylin','Frame','on','Grid','on',... 'MapLatLimit',[-90 90],'MapLonLimit',lonlim, 'MeridianL...

28 days ago | 0

Changing order when calculating frequencies in a loop
plot(CAM(1:i,:),'linewidth',2) Change this line to above inside the _for loop_

30 days ago | 0

Concatenate Columns of Cells
[ii,jj] = find( cellfun('ischar',d)); Replace this line with below in @Andrei code. It should work [ii,jj] = find(cel...

30 days ago | 0

I can't find the error in this code. Please help with the dimension. Error in line 42
clc clear all close all %% Initial and Boundary conditions %% g = 9.81; J = 1.2./1000; h = 0.075; lambda = 0.075; u_st...

1 month ago | 0

| accepted

For loop in for loop
k11=28.21; k21=-4.23; k12=-18.133; k22=2.59; k13=20.815; k23=-2.97; t=0:0.1:3; num_t=length(t); t4=0; t3=-0.3588; t2=...

1 month ago | 0

| accepted

Hello, i receive this error, i am attempting to plot Td with sample h
h = 0:10; n = 1:11; %h and n matrix sizes must be consistent p1 = 1.1; p2 = 2.1; Td = h.*((1-p1.^n - p2*p1.^n)./(p1*p2.^n...

1 month ago | 0

Operator '+' is not supported for operands of type struct
glucose1_5.date = [glucose1_5.date glucose1_5.time]; Try using the above when adding two different formats

1 month ago | 0

| accepted

how to create cell array using matrix data?
A= [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]; B = num2cell(A,1).'; cx = [cell(4,1); {1:5}]; cy = [cell(4,1); ...

1 month ago | 0

Plot 2 bar plots in the same graph. Problem with the legend.
data1 = [19 23]; data2 = [30 40]*rand(1); [n1, xout1] = hist(data1) h1 = bar(xout1,n1); hold on [n2, xout2] = hist(data2) ...

1 month ago | 0

try&erorr
clear , clc fprintf(' \n <<< this program calculate Q in three branched pipes from three tanks >>> \n %12.5f ') ...

1 month ago | 0

Index exceeds matrix dimensions error?
Size = 3; queens(Size) function [queens] = queens(Size) test_board = zeros(Size,Size); final_board = zeros(Size,Size); ro...

1 month ago | 0

I have a phase plot in radians varying from 20 to 26 (a linear graph), how do i convert this plot from -pi to +pi or from 0 to 2 pi?

1 month ago | 0

trying to use a while loop to run through a list created by user inputs to plot one or multiple functions
prompt= 'please choose which funtions you want to plot. A, B, C, and/or D.'; a=[]; g=(prompt) list = {'A','B','C','D'}; i= 1...

1 month ago | 0

Array indices must be positive integers or logical values.
principal = 100000; %input('Enter principal in dollars: '); years = 10; %input('Enter number of years: '); interest = 0.00...

1 month ago | 0

solve nonlinear equations
x0 = [-0.0018; 2.8914; 30.6782; 35.3729; 0.2481]; % Make a starting guess at the solution options=optimset('Display',...

1 month ago | 0

How do I plot fractional orders of the Bessel function of the first kind (e.g. J_{1/3}(x))? Can I still use the besselj function?
clc;clear all;clf; x=-20:0.1:20; J13=besselj(1/3,x); % change the variable befoe use in besselj function figure(1) plot(x,...

1 month ago | 0