matlab matrix with specific elements
조회 수: 1(최근 30일)
표시 이전 댓글
Mohannad Almalki
2020년 10월 16일
댓글: Asad (Mehrzad) Khoddam
2020년 10월 16일
i want to create an m by n matricx and its elements are write by this firmula
a(i, j) = (j − 4)2 (i + 1)−3 + ij
where i is the row number and j is the column number?
댓글 수: 0
채택된 답변
Asad (Mehrzad) Khoddam
2020년 10월 16일
assume that i is from 1 to 5 and j is from 1 to 6:
% i: 1 to 5
% j: 1 to 6
[i,j] = meshgrid(1:5,1:6);
a=2*(j-4).*(i+1)-3+i.*j;
disp(a)
댓글 수: 2
Asad (Mehrzad) Khoddam
2020년 10월 16일
% i: 1 to 5
% j: 1 to 6
[i,j] = meshgrid(1:5,1:6);
a=(j-4).^2.*(i+1).^-3+i+j;
disp(a)
추가 답변(0개)
참고 항목
범주
Find more on Matrix Indexing in Help Center and File Exchange
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!