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!