hello everybody ,
I have a small code , I want to save the values of ab so in newwidt so that I can call them later newwidt(1) ,newwidt(2) ....etc
Sn is a 7*9 matrix , the results are not saving, I know it false as I wrote (saving part).
[a,b]=size(Sn);
newwidt=zeros(size(Sn));
for i=1:b
ab=repmat(Sn(:,i),1,b)
newwidt=ab(:,:)
end
thanks

 Respuesta aceptada

aborghes
aborghes el 19 de Jun. de 2017

1 voto

does changing newwidt=ab(:,:) to newwidt(:)=ab(:,:) do what you are looking for? This saves each value in an array of doubles.

3 comentarios

heir ancestors
heir ancestors el 19 de Jun. de 2017
hi ! thank you for your answer , unfortunately no , in this case it is saving only the last matrix for newwidt and I can't call the previous values/matrix of it.
aborghes
aborghes el 19 de Jun. de 2017
sorry about that, i miss-typed. try newwidt(:,:,i). that saves each result in a new array that are all accessible.
heir ancestors
heir ancestors el 21 de Jun. de 2017
Amazing !! it's woking, thank you very much :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 19 de Jun. de 2017

Comentada:

el 21 de Jun. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by