Help with Array Induces (left and right side are incompatible)
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Matt Trenton
el 5 de Nov. de 2018
Comentada: Stephen23
el 5 de Nov. de 2018
The following code: ...
Gets me the error
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
Error in Title_here (line 40)
k(j)=B(1,:);
If I need the code to save each loop of n results to later make an histogram of all the results of said loop m times. then how should I do it so it works?
0 comentarios
Respuesta aceptada
madhan ravi
el 5 de Nov. de 2018
k = cell(1); % before loop
k{i}=B(1,:) %change this
1 comentario
Stephen23
el 5 de Nov. de 2018
It is good practice to preallocate the cell array to the correct size before the loop.
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!