Storing values in a variable
1 次查看(过去 30 天)
显示 更早的评论
I want to store values in a variable annd return it to another function
For example,
function A = fun()
A([2 3 4]) = [1 4 7]
end
dA([2 3 4]) = fun()
This doesn't work because A has a zero saved at index 1 and fun returns a 4 x 1array.Is there a way to return A as a 3 x 1 array while saving values only at index 2, 3 and 4 ?
2 个评论
KALYAN ACHARJYA
2019-11-24
@Rik :)
Is there a way to return A as a 3 x 1 array while saving values only at index 2, 3 and 4 ?
@Deepa Why? Is there any logic?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!