How to print numbers 1 to 4 and add all numbers to a one array?
3 ビュー (過去 30 日間)
古いコメントを表示
results
1
2
3
4
a= [1 2 3 4];
2 件のコメント
採用された回答
Awais Saeed
2021 年 8 月 23 日
Perhaps this is what you want
for col =1:1:4
disp(col)
a(col) = col;
end
disp(['a = ',num2str(a)])
6 件のコメント
Awais Saeed
2021 年 8 月 24 日
Because you are not storing anything. I am assuming you want to store 'q' values
f = -6:0.001:6;
n = -6:6;
xt = (-2<=n & n<=2);
output = [];
for t = -6:0.001:6
fun = @(f)exp(j.*2.*pi.*f.*t);
q = integral(@(f) fun(f),-2,2);
output = [output q]; % store q values
end
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!