Borrar filtros
Borrar filtros

Error using plot Vectors must be the same length.

1 visualización (últimos 30 días)
Dursman Mchabe
Dursman Mchabe el 3 de Oct. de 2018
Comentada: Dursman Mchabe el 3 de Oct. de 2018
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)

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 3 de Oct. de 2018
Editada: KALYAN ACHARJYA el 3 de Oct. de 2018
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 comentario
Dursman Mchabe
Dursman Mchabe el 3 de Oct. de 2018
Thanks a lot, KALYAN ACHARJYA. I am actually trying to reproduce the attached m-file by Igor Moura.

Iniciar sesión para comentar.

Más respuestas (1)

KSSV
KSSV el 3 de Oct. de 2018
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 comentario
Dursman Mchabe
Dursman Mchabe el 3 de Oct. de 2018
I want Cfit to be 1*30 as well, I don't know how to do it.

Iniciar sesión para comentar.

Categorías

Más información sobre Fit Postprocessing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by