I get an error in line 4, which is the y= ...exp... It just says " Error", what can i do to plot my function?
clear, clf
x=[0:10:1000];
y=2*(1)^2*(1-exp(-(x/100)^(1.4)));
% g=3*x;
xlabel('R [a.u.]')
ylabel('Intensity')
hold on
plot(x,y,'LineWidth',1.6,'DisplayName','\epsilon=100; \sigma=1Å ')
% plot(x,g,'LineWidth',1.6,'DisplayName','NA_2=0.8')
hold off
legend({},'Fontsize',14,'Location','northwest')
set(gca,'FontSize',14);

댓글 수: 1

Simon Chan
Simon Chan 2021년 7월 9일
Just add a dot in front of ^
y=2*(1)^2*(1-exp(-(x/100).^(1.4)));

댓글을 달려면 로그인하십시오.

 채택된 답변

KSSV
KSSV 2021년 7월 9일

0 개 추천

clear, clf
x=[0:10:1000];
y=2*(1)^2*(1-exp(-(x/100).^(1.4))); % <---- element by element operation
% g=3*x;
xlabel('R [a.u.]')
ylabel('Intensity')
hold on
plot(x,y,'LineWidth',1.6,'DisplayName','\epsilon=100; \sigma=1Å ')
% plot(x,g,'LineWidth',1.6,'DisplayName','NA_2=0.8')
hold off
legend({},'Fontsize',14,'Location','northwest')
set(gca,'FontSize',14);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Line Plots에 대해 자세히 알아보기

질문:

2021년 7월 9일

댓글:

2021년 7월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by