From: Heman Koka on
Hi All,
I am using Matlab Simulink for my project. I am trying to give the input from a file. But my file is in text format and the block for the input file takes only .MAT format.

How do i create the .MAT format file?
Please help me guyz...

Thank you
From: us on
"Heman Koka" <kokahemant(a)hotmail.com> wrote in message <i0j31a$ql$1(a)fred.mathworks.com>...
> Hi All,
> I am using Matlab Simulink for my project. I am trying to give the input from a file. But my file is in text format and the block for the input file takes only .MAT format.
>
> How do i create the .MAT format file?
> Please help me guyz...
>
> Thank you

one of the solutions

m=magic(3);
fasc='foo.txt'; % <- your ASCII file...
fmat='foo.mat'; % <- your new MAT file...
% create the ASCII file
save(fasc,'m','-ascii');
% - turn it into a MAT file
masc=load(fasc,'-ascii');
save(fmat,'masc');

us
From: Heman Koka on
Hi us,

Thankx for the response. I would like to know if this code for conversion should be written in a .m file or on command prompt of MATLAB.

Thank you

"us " <us(a)neurol.unizh.ch> wrote in message <i0j3i7$4o8$1(a)fred.mathworks.com>...
> "Heman Koka" <kokahemant(a)hotmail.com> wrote in message <i0j31a$ql$1(a)fred.mathworks.com>...
> > Hi All,
> > I am using Matlab Simulink for my project. I am trying to give the input from a file. But my file is in text format and the block for the input file takes only .MAT format.
> >
> > How do i create the .MAT format file?
> > Please help me guyz...
> >
> > Thank you
>
> one of the solutions
>
> m=magic(3);
> fasc='foo.txt'; % <- your ASCII file...
> fmat='foo.mat'; % <- your new MAT file...
> % create the ASCII file
> save(fasc,'m','-ascii');
> % - turn it into a MAT file
> masc=load(fasc,'-ascii');
> save(fmat,'masc');
>
> us
From: us on
"Heman Koka" <kokahemant(a)hotmail.com> wrote in message <i0j6r9$266$1(a)fred.mathworks.com>...
> Hi us,
>
> Thankx for the response. I would like to know if this code for conversion should be written in a .m file or on command prompt of MATLAB.
>
> Thank you

plase, do NOT top-post...

then, it's a matter of taste...
eg,
- if you have one file only -> command prompt...
- if you have >one file -> M-file...

us
From: Heman Koka on
"us " <us(a)neurol.unizh.ch> wrote in message <i0j76h$nc1$1(a)fred.mathworks.com>...
> "Heman Koka" <kokahemant(a)hotmail.com> wrote in message <i0j6r9$266$1(a)fred.mathworks.com>...
> > Hi us,
> >
> > Thankx for the response. I would like to know if this code for conversion should be written in a .m file or on command prompt of MATLAB.
> >
> > Thank you
>
> plase, do NOT top-post...
>
> then, it's a matter of taste...
> eg,
> - if you have one file only -> command prompt...
> - if you have >one file -> M-file...
>
> us

Hi us,

I tried running in the m-file.
But, the file being generated is shortcut.
I have just changed the file name assigned to fasc and fmat. rest of the code is same.

I tried using the mat file name to the block but there is an error being displayed:

"Time values in file 'Coeff_RFile.mat' must be monotonically non-decreasing"

I couldn't understand wht this error is about.

Thank you
 |  Next  |  Last
Pages: 1 2
Prev: GUI Table: Indicate what is selected.
Next: Quotations