I have some problem when plotting the graph, anyone can help? Thanks

조회 수: 1 (최근 30일)
This is my code
for x = -10:10
y = 2^(0.4*x)+5
plot(x,y,'g')
end

채택된 답변

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015년 6월 27일
편집: Salaheddin Hosseinzadeh 2015년 6월 27일
Hi,
You need to store y first.
x = -10:10;
for i = 1:numel(x)
y(i) = 2^(0.4*x(i))+5
end
plot(x,y,'g')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by