Transfer elements from 1 matrix to another
Mostrar comentarios más antiguos
I have 2 matrices path one is path which is 6x2 and sample8 which is 3X3. I want to extract an element from sample8 and put it in path as shown below:
path(i,1)=sample8(1,1)
When I do this I get no change in path Please help
3 comentarios
Geoff Hayes
el 1 de Dic. de 2015
Ken - are you sure that this line of code is being executed? What happens if you put a breakpoint at this line and then run your code? When the debugger pauses at this line, look at the value for i, path before the update, sample8, and path after the update. Please describe the values for each of these two small matrices and perhaps include more of your code so that we can get an idea of what else is happening.
Ken
el 1 de Dic. de 2015
Editada: Walter Roberson
el 1 de Dic. de 2015
Walter Roberson
el 1 de Dic. de 2015
You are replacing a 1 with a 1. What output were you expecting?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Operating on Diagonal Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!