not compatible with the size
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
SANDIPKUMAR ROYADHIKARI
el 11 de Dic. de 2021
Comentada: Walter Roberson
el 12 de Dic. de 2021
itr=0; % number of iteration
for t=1:1:3
itr=itr+1;
b(itr)=[sin(t) cos(t)];
end
In the above code , I am getting the error " Unable to perform assignment because the indices on the left side are not compatible with the size of the right side."
Please tell me how to fix.
0 comentarios
Respuesta aceptada
Chunru
el 11 de Dic. de 2021
itr=0; % number of iteration
for t=1:1:3
itr=itr+1;
b(itr, :)=[sin(t) cos(t)]; % Two numbers for each iteration form a row for a matrix b (nitr x 2)
end
b
Más respuestas (0)
Ver también
Categorías
Más información sobre Shifting and Sorting Matrices 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!