How to do a 2 compoment vector?

3 ビュー (過去 30 日間)
Laura T
Laura T 2021 年 12 月 6 日
コメント済み: DGM 2021 年 12 月 6 日
HI, I have been working on using matlab recently however i am stuck on how to create a 2 component vector.
i have the vector A=[0:0.01:pi/2].
And loop:
for i = A
i = 0.01:length(A)
end
How do i create a 2 component vector inside this vector that which the first component is 1 and the second component is tan(LoopVariable) and then normalise this vector?
thanks in advance
  2 件のコメント
HWIK
HWIK 2021 年 12 月 6 日
Maybe its just me, but I'm not making much sense of what you have written here. You might want to try and rephrase that.
DGM
DGM 2021 年 12 月 6 日
Is this what you're after?
A = 0:0.01:pi/2;
for k = 1:numel(A)
myvec = [1 tan(A(k))]; % a 2-component vector
myvec = myvec/norm(myvec); % normalized
% ...
end

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by