Community Profile

photo

Advait Sinha


Active since 2019

Followers: 0   Following: 0

Statistics

Feeds

View by

Question


I want to plot z such that z(:,1)= [0;1]; but how do I implement that in this code
close all; dt = 0.1;%time step u1=1; u2=2; c = u2-u1; u = sign(u2-u1); z=u*c; k=0.12; m=2.21;%initial parameters...

5 years ago | 0 answers | 0

0

answers

Question


How can I put the value of z in a matrix and later call it as z(1,i) and z(2,i) in the while loop?
close all; dt = 0.1;%time step u1=1; u2=1; c = u2-u1; u = sign(u2-u1); z = u*c; k=0.12; m=2.21;%initial parameters ...

5 years ago | 2 answers | 0

2

answers

Answered
How can I put the value of z in a matrix and later call it as z(1,i) and z(2,i) in the while loop?
But then what would happen to the other equations that also make use of z. Also would I need to implement z as a matrix before t...

5 years ago | 0

Question


Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 2-by-1. Error in linear2d (line 7) z(:,1)=[0;1];
close all; dt = 0.1;%time step u1=1; u2=1; c = u2-u1; u = sign(u2-u1); z(:,1)=[0,1]; k=0.12; m=2.21;%initial paramet...

5 years ago | 2 answers | 0

2

answers

Question


Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='. in column 20
close all; dt = 0.464;%time step u1=1; u2=1; k=0.12; m=2.21;%initial parameters v=1; a=1.4; tend=100; t=0; i...

5 years ago | 0 answers | 0

0

answers

Question


How can i implement u1(i)- u2(i) in the while loop instead of u(i) and plot the graph against that too instead of u
close all; dt = 0.464;%time step u=1; k=0.12; m=2.21;%initial parameters v=1; a=1.4; tend=100; t=0; i=1 whil...

5 years ago | 0 answers | 0

0

answers

Question


Undefined function sgn(z)
close all; dt = 0.01;%time step k=1; m=1;%initial parameters u1 =1; u2 =2; z = u2-u1; c = sgn(z); h = c*z; v=1; a=1;...

5 years ago | 1 answer | 1

1

answer

Question


Index exceeds the number of elements (1)
close all; dt = 0.01;%time step k1=1; m=1;%initial parameters u1 =2; u2 =1; v1=2; a1=1; tend=10; t=0; i=1 whi...

5 years ago | 1 answer | 0

1

answer