Creating a *.mat file
622 次查看(过去 30 天)
显示 更早的评论
Hello, I want to create a *.mat file, for example named bathymetry. This array called bathymetry I want to be formed by 3 other arrays, for example, x, y and z. In a way, that when I charged the mat file it transforms into three files called x, y and z.
I've tried my easy way: for example: bathymetry=[x,y,z], but when I charged it, it's only 1 file called bathymetry and I want to have them separetely.
Please help me.
2 个评论
采纳的回答
更多回答(8 个)
the cyclist
2013-2-12
Do you mean this?
% Create some variables
x = rand(3);
y = magic(3);
z = eye(3);
% Save the variable x,y,z into one *.mat file
save bathymetry.mat x y z
% Clear them out of the workspace
clear x y z
% Load them again
load bathymetry.mat
5 个评论
Walter Roberson
2016-9-22
Machine Learning & Power Systems Ali: we are going to need more detail than that. What is your code, and what is your exact error message?
matija corak
2015-1-26
Hello, I need help. I was record on my phone a sound. I want to hear that sound in matlab. How to do that? Thanks.
1 个评论
matija corak
2015-1-26
I already tried with load and audioread and so on. Than I tried that sound convert in .wav and he still does not recognize that file. When I put for example load pcela.wav % pcela.wav is my name of that recorded sound Error using load Unknown text on line number 1 of ASCII file pcela.wav "RIFF’_".
Am I doing something wrong? Please help me I don't have no idea anymore and I cant find anything similar on web.
Lobna Ragab
2016-1-15
How can I add many records to that file, I mean like
save filename X Y
X = 1,2,3,4
Y = 5,6,7,8
like table?
1 个评论
geetu yadav
2016-4-5
svmStructDisease = svmtrain(diseasefeat,diseasetype); in this code how to create diseasefeat and diseasetype file?
1 个评论
Shivaprasad S
2016-4-13
Same problem I am also facing please give some idea how to create I don't know anything please
Machine Learning Enthusiast
2016-9-22
@ the cyclist
2 个评论
Bjorn Gustavsson
2016-9-22
That typically means that you don't have write permissions in the current directory. Move to somewhere else (cd...) and try again.
HTH
Walter Roberson
2016-9-22
You are probably cd'd to a directory that is underneath the MATLAB installation. The directory that MATLAB starts executing in is not necessarily your personal MATLAB directory.
Saravanan Nagesh
2018-3-27
@Machine Learning Enthusiast
Check the following code for the path of the current Matlab folder
path = pwd
use 'cd' to change it to another folder with write access.
usually, the default folder for Matlab code in most cases is" 'C:\Users\xxx'"
changing it to another drive solves this
0 个评论
tuncel3
2021-7-2
First define a file name with its location
saveFileName='datafiles\filename2.mat';
next use below code to create an empty .mat file
save(saveFileName);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!