Transfer elements from 1 matrix to another
Ältere Kommentare anzeigen
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 Kommentare
Geoff Hayes
am 1 Dez. 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
am 1 Dez. 2015
Bearbeitet: Walter Roberson
am 1 Dez. 2015
Walter Roberson
am 1 Dez. 2015
You are replacing a 1 with a 1. What output were you expecting?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Operating on Diagonal Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!