필터 지우기
필터 지우기

How to import .mat file in MATLAB?

조회 수: 10 (최근 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 CenterFile Exchange에서 Tables에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by