Assign a value to a matrix element defined as a variable
显示 更早的评论
Hi all,
Is it possible to assign values (variables) to elements in a matrix that is defined as a function handle?
For example:
prop1 = zeros(2);
prop1(:,1) = 1;
prop1(:,2) = 2;
prop1
prop2 = @(x) [0 0;
0 0]
prop2(:,2) = @(x) x(2)
I would like to assign variables to prop2 as I did to prop1.
2 个评论
Geovane Gomes
2023-6-17
编辑:Geovane Gomes
2023-6-17
Steven Lord
2023-6-17
Use repmat or repelem.
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!