Transfer elements from 1 matrix to another
显示 更早的评论
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 个评论
Geoff Hayes
2015-12-1
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
2015-12-1
编辑:Walter Roberson
2015-12-1
Walter Roberson
2015-12-1
You are replacing a 1 with a 1. What output were you expecting?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!