How to plot this ?

조회 수: 2 (최근 30일)
Priya
Priya 2014년 2월 16일
댓글: Priya 2014년 2월 16일
Could anyone please assist me on how to plot the below piece of code,
residsumsq = norm(simout_b(:,1)-simout_a(:,1),2)^2;
tsumsq = norm(simout_b(:,1)-mean(simout_b(:,1)),2)^2;
R2 = 1-(residsumsq/tsumsq);
Also how to display the R square value on running the mfile. Please help.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 16일
Your can't plot your code.
%example
simout_a=rand(10,2);
simout_b=rand(10,2);
residsumsq = norm(simout_b(:,1)-simout_a(:,1),2)^2;
tsumsq = norm(simout_b(:,1)-mean(simout_b(:,1)),2)^2;
R2 = 1-(residsumsq/tsumsq);
Your result are all scalar
Can you explain what you need to plot? maybe
plot(simout_a(:,1));
hold on;
plot(simout_b(:,1));
hold off
  댓글 수: 1
Priya
Priya 2014년 2월 16일
Thanks for your reply. Actually I wanted to get the pictorial representation of "R2 = 1-(residsumsq/tsumsq)" . Thought I could see the Rsquare fit in the form of a plot.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by