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 で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!