Clear Filters
Clear Filters

X,Yに定義する

3 views (last 30 days)
皓
on 31 May 2023
Commented: on 2 Jun 2023
初歩的な質問だと思うのですが、CSVのファイルを読み込むんで、x,yを定義する方法が分からないです。
宜しくお願いします。

Accepted Answer

Atsushi Ueno
Atsushi Ueno on 31 May 2023
>x,yを定義する方法が分からないです
  • データインポートツールで枠線をマウスで選択してインポートします
  • 読み込んだデータの変数はワークスペースにリストアップされます
  • 出力タイプを「数値行列」にする
  • マウスで枠線部(3か所)を選択する(作業を3回繰り返します)
  • 選択したら「選択のインポート」をクリックする
  • ワークスペースに現れた変数名をuntitledからx等に変更する
データのプロットもマウス操作で出来ますが、下記ではプログラムでグラフ描画しています。
n = 20;
x = 1:n;
y = (1:n)'; % 赤枠部(x)と緑枠部(y)の模擬データ
z = rand(n) + 10.0; % 黄色枠部(z)の模擬データ
[X,Y] = meshgrid(x,y);
surf(X,Y,z);
zlim([0 20]);
  4 Comments
Atsushi Ueno
Atsushi Ueno on 1 Jun 2023
皓
on 2 Jun 2023
ありがとうございます。
そちらを確認いたします。

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB 入門 in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!