フィルターのクリア

How to do correctly DFT of the x,y data?

2 ビュー (過去 30 日間)
Veronika
Veronika 2017 年 1 月 1 日
コメント済み: Veronika 2017 年 1 月 4 日
Dear all,
I have coordinates x_okoli,y_okoli and I would like to show output, but this error appears:
Undefined function 'fftgui' for input arguments of type 'double'.
Error in mesh_okoli (line 96) fftgui(m)
This is my code: x = x_okoli(1,1); y = y_okoli(1,1); z = x + i*y; A = abs(z); fi = angle(z); %fi2 = atan2(imag(z),real(z)) f = 50; omega = 2*pi*f; m = A*cos(omega*x+fi)+A*i*sin(omega*y+fi); figure(7) fftgui(m)
Thank you for your answers.
  3 件のコメント
Veronika
Veronika 2017 年 1 月 2 日
Thank you.
Veronika
Veronika 2017 年 1 月 2 日
編集済み: Veronika 2017 年 1 月 2 日
For one coordinate value it works, but for all the coordinates it says this error:
Error using *
Inner matrix dimensions must agree.
Error in mesh_okoli (line 94)
m = A*cos(omega*x+fi)+A*i*sin(omega*y+fi);
This is my code:
for x = x_okoli(:,1);
y = y_okoli(:,1);
z = x + i*y;
A = abs(z);
fi = angle(z);
%fi2 = atan2(imag(z),real(z))
f = 50;
omega = 2*pi*f;
m = A*cos(omega*x+fi)+A*i*sin(omega*y+fi);
figure(7)
fftgui(m)
end
x_okoli and y_okoli is my coordinates. I attach my code too. Can you help me and tell where is the mistake?
Thank you for your answer.

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

回答 (1 件)

Image Analyst
Image Analyst 2017 年 1 月 2 日
Regarding
m = A*cos(omega*x+fi)+A*i*sin(omega*y+fi);
either look in the debugger (like most people) or add these lines before that line
whos A
whos i
whos omega
whos y
whos fi
First read this link and then, in the editor in MATLAB, type control a (to select all) and control i (to properly indent) then copy, then paste your answer back here.
Chances are, one of those is an array and you were expecting a scalar, so it's doing a matrix multiply instead of a scalar or element-by-element multiply.
  1 件のコメント
Veronika
Veronika 2017 年 1 月 4 日
%%Mesh okolí
for x = x_okoli(:,1);
y = y_okoli(:,1);
z = x + i*y;
A = abs(z);
fi = angle(z);
%fi2 = atan2(imag(z),real(z))
f = 50;
omega = 2*pi*f;
m = A*cos(omega*x+fi)+A*i*sin(omega*y+fi);
figure(7)
fftgui(m)
end
I attach whole code.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by