extracting value from a matrix
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Maria Imdad
 el 19 de Abr. de 2021
  
    
    
    
    
    Respondida: Rafael Hernandez-Walls
      
 el 19 de Abr. de 2021
            Hi everyone, 
I have this matrix "X" of one row and 64 columns, it has only binary values as given by 
X=[1000000000000000000000000000000000000000000000000000000000000000];
I want help to create a for loop which helps me extract each value from this matrix, column by column and save the obtained vaue to another variable, Y. 
1 comentario
  Paul Hoffrichter
 el 19 de Abr. de 2021
				This free self-paced course will help you learn a good deal about Matlab operations. After you take this course, please post some code if you are still having some issues.
Respuesta aceptada
  Rafael Hernandez-Walls
      
 el 19 de Abr. de 2021
        I think it is better to put the variable X as a string and from there start. for example:
X=['1000000000000000000000000000000000000000000000000000000000000000'];
[~,m]=size(X);
for k=1:m
    Y(k)=str2num(X(k));
end
Y
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Creating and Concatenating 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!


