フィルターのクリア

How to plot for this function?

1 回表示 (過去 30 日間)
soe min aung
soe min aung 2021 年 1 月 22 日
コメント済み: soe min aung 2021 年 1 月 22 日
clear all
close all
clc
x = 0:100;
y = linspace(50,150,101)
[X,Y] = meshgrid(x,y);
f = cos((pi.*x)./50).*sin((pi.*y)./100);
surf(X,Y,f)

採用された回答

Rik
Rik 2021 年 1 月 22 日
編集済み: Rik 2021 年 1 月 22 日
You forgot to use the variables you just created:
x = 0:100;
y = linspace(50,150,101);
[X,Y] = meshgrid(x,y);
f = cos((pi.*X)./50).*sin((pi.*Y)./100);
% ^ not x, but X ^ not y, but Y
surf(X,Y,f)
You should also avoid the habit of starting your code with clear all,close all,clc. Especially that first one should be avoided. During debugging you can use clear or clearvars to remove variables, otherwise use functions.
  1 件のコメント
soe min aung
soe min aung 2021 年 1 月 22 日
Thank you so much...sir

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by