フィルターのクリア

finding the right matrix

3 ビュー (過去 30 日間)
alexis cordova
alexis cordova 2019 年 8 月 4 日
コメント済み: Walter Roberson 2019 年 8 月 4 日
ni(i,1:2) is supposed to be a 2x2 vector but i keep getting a 1x2, help please
x = [0 0; 200 0; 200 25; 25 25; 25 200; 0 200;0 0];
n = size(x,1); % size will be equal to 7
n = n-1;
% initialize properties
Asum = 0 ; % a scalar
psum = zeros(1,2); % 1 x 2 matrix
R = zeros(2,2); % 2 x 2 matrix
% 3. loop over sides
for i = 1:n % 5 points
h(i) = norm(x(i,:));
% from 3a as well
ni(i,1:2) = x(i,:)'; %------------------------------------
b(i) =norm(x(i+1,:)-(x(i,:)));
mi(i,1:2) = (x(i+1,:)-x(i,:))';
if h>0
ni = ni/h(i);
end
if b(i)>0
mi(i,1:2) = mi(i,1:2)/b(i);
end
  5 件のコメント
alexis cordova
alexis cordova 2019 年 8 月 4 日
so when the loop is ran once im trying to get this below for mi and ni and aslo store it
Capture.PNG
but instead im getting
Capture.PNG
Walter Roberson
Walter Roberson 2019 年 8 月 4 日
mi(i,1:2) = (x(i+1,:)-x(i,:))';
The left hand side is one row and two columns. Perhaps you want
mi(1:2, i) = (x(i+1,:)-x(i,:)).';

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by