I am new to Matlab and I am looking for help regarding this questions as attached

1 回表示 (過去 30 日間)
Osama Ahmed
Osama Ahmed 2017 年 8 月 29 日
編集済み: Ahmed Grera 2017 年 9 月 5 日
Creating a matrix using a "for-loop" and "create" commands.

回答 (3 件)

Walter Roberson
Walter Roberson 2017 年 8 月 29 日

Image Analyst
Image Analyst 2017 年 8 月 29 日
For the "for loop" portion of the task:
counter = 1
for row = 1 : 5
for col = 1 : 8
A(row, col) = .....
counter......
end
end
You can finish it by replacing the ... with the appropriate code.
For the "create" command -- I have no idea what that is. I've never heard of the create() command.

Ahmed Grera
Ahmed Grera 2017 年 9 月 5 日
編集済み: Ahmed Grera 2017 年 9 月 5 日
clc
clear all
a=zeros(8,5); % zeros matrix
for i=1:1:40
a(i)=i;
end
b=a' % transpose of matrix (a)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by