Transfer elements from 1 matrix to another
Show older comments
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 Comments
Geoff Hayes
on 1 Dec 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
on 1 Dec 2015
Edited: Walter Roberson
on 1 Dec 2015
Walter Roberson
on 1 Dec 2015
You are replacing a 1 with a 1. What output were you expecting?
Accepted Answer
More Answers (0)
Categories
Find more on Operating on Diagonal Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!