Error using plot Vectors must be the same length.

조회 수: 2 (최근 30일)
Dursman Mchabe
Dursman Mchabe 2018년 10월 3일
댓글: Dursman Mchabe 2018년 10월 3일
Hi everyone,
How can I change the size of Cfit in line 140 of the attached to double(30 x 8), in the attached code. When I run the code, I get error message:
Error using plot
Vectors must be the same length.
Error in fitting (line 145)
plot(tv,Cfit)

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 10월 3일
편집: KALYAN ACHARJYA 2018년 10월 3일
Hello @Dursman Before Plot please ensure that both Cfit and tv dimension should be same.
You have used the nesting of functions, within the code please check the following lines
tv=linspace(0,max(ExpTime),length(ExpTime));
Cfit=kinetics(theta,tv);
I think you can change the length of tv by considering more/or less data in
ExpTime=[600
1200
...
....
Carefully look at the expressions, match the dimension then only go for the plot. Linspace documentation
Do the work, if you still unable to find it let me know.
  댓글 수: 1
Dursman Mchabe
Dursman Mchabe 2018년 10월 3일
Thanks a lot, KALYAN ACHARJYA. I am actually trying to reproduce the attached m-file by Igor Moura.

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

추가 답변 (1개)

KSSV
KSSV 2018년 10월 3일
The dimensions of tv are 1*30 and Cfit are 1*8..how you can plot them? You cannot...to plot the dimensions of the inputs should be same.
  댓글 수: 1
Dursman Mchabe
Dursman Mchabe 2018년 10월 3일
I want Cfit to be 1*30 as well, I don't know how to do it.

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

카테고리

Help CenterFile Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by