How can I fix this error?
Why I am getting "Error Using Plot , invalid color or line type " in line 15
조회 수: 33 (최근 30일)
이전 댓글 표시
댓글 수: 2
답변 (2개)
Vignesh Murugavel
2021년 8월 4일
댓글 수: 3
Walter Roberson
2021년 8월 4일
On line 15 of your code you have '-5'. What did you intend by the 5 part of that?
reza
2023년 11월 11일
편집: Walter Roberson
2023년 11월 12일
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
Walter Roberson
2023년 11월 12일
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
2023년 11월 12일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Stateflow Programmatic Interface에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!