getting a flat surface graph

4 ビュー (過去 30 日間)
Tom
Tom 2012 年 1 月 9 日
I've got this equation, which I wanted to see a plot of so I put it into Matlab hoping to gain a little insight. Instead I just get a flat surface, which is not what Mathematica shows. Here's the code,
close all;
clear all;
f=linspace(0,1000,50);
t=linspace(0,0.0005,50);
[ff,tt] = meshgrid(f,t);
x=4-cos(2*pi*ff*tt);
surf(ff,tt,x)
  1 件のコメント
Matt Fig
Matt Fig 2012 年 11 月 2 日
I've got this equation, which I wanted to see a plot of so I put it into Matlab hoping to gain a little insight. Instead I just get a flat surface, which is not what Mathematica shows. Here's the code,
close all;
clear all;
f=linspace(0,1000,50);
t=linspace(0,0.0005,50);
[ff,tt] = meshgrid(f,t);
x=4-cos(2*pi*ff*tt);
surf(ff,tt,x)

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

採用された回答

Walter Roberson
Walter Roberson 2012 年 1 月 9 日
x = 4 - cos(2 .* pi .* ff .* tt);
Remember, * is matrix multiplication.
  1 件のコメント
Tom
Tom 2012 年 1 月 9 日
Of course - thanks.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by