Why I am getting "Error Using Plot , invalid color or line type " in line 15
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/702392/image.jpeg)
2 Kommentare
Antworten (2)
Vignesh Murugavel
am 4 Aug. 2021
3 Kommentare
Walter Roberson
am 4 Aug. 2021
On line 15 of your code you have '-5'. What did you intend by the 5 part of that?
reza
am 11 Nov. 2023
Bearbeitet: Walter Roberson
am 12 Nov. 2023
clc;
clear;
close all;
y=-1:10;
G=1:10;
c=5;
t=10;
D=3;
u_y='((-G*y^2)/2)+(c*y)+(t*y)+(4((t^(1/2)/3*G)*((c-G*y)^(3/2))+D)';
plot(y,u_y)
xlabel('y')
ylablel('u_y')
2 Kommentare
Walter Roberson
am 12 Nov. 2023
y=-1:10;
G = (1:10).';
c=5;
t=10;
D=3;
u_y=((-G.*y.^2)/2)+(c.*y)+(t.*y)+(4.*((t.^(1/2)/3.*G).*((c-G.*y).^(3/2))+D));
plot(y,u_y)
xlabel('y')
ylabel('u_y')
Walter Roberson
am 12 Nov. 2023
Note that your y and G are different sizes -- 12 and 10 -- so you cannot combine them by element-by-element operations... not unless you transpose one of them and use implicit expansion.
Siehe auch
Kategorien
Mehr zu Stateflow Programmatic Interface finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!