How do i multiply 2 increasing variables
古いコメントを表示
Hello everyone i was wondering if u could help me multiply these two increasing variables. They just do not multiply correctly
v0 = (10:1:20);
theta = (30:1:40);
v0_x = v0.*cosd(theta);
v0_y = v0.*sind(theta);
6 件のコメント
dpb
2020 年 8 月 14 日
What do you think is incorrect?
It may not be what you were trying to compute, but the result of the two expressions is certainly what would be expected by MATLAB syntax.
Steven Lord
2020 年 8 月 14 日
What does "do not multiply correctly" mean in this context?
- Do you receive warning and/or error messages? If so the full and exact text of those messages (all the text displayed in orange and/or red in the Command Window) may be useful in determining what's going on and how to avoid the warning and/or error.
- Does it do something different than what you expected? If so, what did it do and what did you expect it to do?
- Did MATLAB crash? If so please send the crash log file (with a description of what you were running or doing in MATLAB when the crash occured) to Technical Support using the telephone icon in the upper-right corner of this page so we can investigate.
Sara Boznik
2020 年 8 月 14 日
I think is correct.
Ilker Enes Çirkin
2020 年 8 月 14 日
KSSV
2020 年 8 月 14 日
To get this you need to use symbolic tool box.
Sara Boznik
2020 年 8 月 14 日
for v0 = 10:1:20;
for theta = 30:1:40;
v0_x = v0.*cosd(theta)
v0_y = v0.*sind(theta)
end
end
Do you need this?
採用された回答
その他の回答 (1 件)
Bruno Luong
2020 年 8 月 14 日
編集済み: Bruno Luong
2020 年 8 月 14 日
v0 = (10:1:20);
theta = (30:1:40);
v0_x = v0.*cosd(theta.'); % horizontal .* vertical vectors
v0_y = v0.*sind(theta.');
カテゴリ
ヘルプ センター および File Exchange で Historical Contests についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!