フィルターのクリア

Data dimensions must agree error

14 ビュー (過去 30 日間)
Fatma Abdullah
Fatma Abdullah 2017 年 6 月 28 日
編集済み: Swietoslawa Klos 2019 年 10 月 28 日
can anyone help me here,,there is a problem with "mesh" but i dont know how to fix
if true
% Use this program to reproduce Fig. 4.2 of text
close all
clear all
eps = 0.000001;
taup = 3.;
taumin = -1.1 * taup;
taumax = -taumin;
x = single_pulse_ambg(taup);
taux = taumin:.05:taumax;
fdy = -7/taup:.05:7/taup;
figure(1)
mesh(taux,fdy,x);
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
zlabel ('Ambiguity function')
colormap([.5 .5 .5])
colormap (gray)
figure(2)
contour(taux,fdy,x);
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
colormap([.5 .5 .5])
colormap (gray)
grid
y = x.^2;
figure(3)
mesh(taux,fdy,y);
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
zlabel ('Ambiguity function')
colormap([.5 .5 .5])
colormap (gray)
figure(4)
contour(taux,fdy,y);
xlabel ('Delay - seconds')
ylabel ('Doppler - Hz')
colormap([.5 .5 .5])
colormap (gray)
grid
end
  2 件のコメント
Jan
Jan 2017 年 6 月 28 日
編集済み: Jan 2017 年 6 月 28 日
Please do not only mention, that there is an error, but provide as much information as possible: Post a copy of the complete error message. Then the readers do not have to guess, in which line the problem occurres.
Redefining built-in functions causes unexpected behavior frequently: do not use "eps" as a variable.
KSSV
KSSV 2017 年 6 月 29 日
mesh(taux,fdy,x);
Your taux,fdy,x are vectors, you cannot use mesh like that. You need to convert them into matrices using meshgrid and then use mesh. Read the documentation of mesh .

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

回答 (1 件)

Swietoslawa Klos
Swietoslawa Klos 2019 年 10 月 21 日
編集済み: Swietoslawa Klos 2019 年 10 月 28 日
Nevermind, Solved it. Stupid me^^´

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by