How to import .mat file in MATLAB?

56 ビュー (過去 30 日間)
Bidyarani
Bidyarani 2023 年 1 月 19 日
コメント済み: Bidyarani 2023 年 1 月 20 日
i have been trying to import a data in .mat format and after i select the file, "import wizard" window pops up which is shown below. When i click finish button but it shows a blank window. I am not able to import the .mat file. Can someone help me out? thank you in advance.

採用された回答

Kunal Kandhari
Kunal Kandhari 2023 年 1 月 19 日
Hi Bidyarani,
You can make use of load function to read the .mat file into MATLAB.
Below is the sample code for that:
filename = 'test.mat';
load(filename)
You can read more about the load function here: Load variables from file into workspace
Hope this helps!
  3 件のコメント
Kunal Kandhari
Kunal Kandhari 2023 年 1 月 20 日
Can you please try this out:
In command window, run this command:
clear
it will clear your workspace and then run the following code:
myVars = {'d_users','cellular_users','pathloss_users','pathloss_cellular'};
load(filename,myVars{:})
disp(cellular_users)
And let me know the output
Bidyarani
Bidyarani 2023 年 1 月 20 日
@Kunal Kandhari thanks. It works. The values of the variables are displayed correctly.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by