mopen command help needed

classic Classic list List threaded Threaded
3 messages Options
Stephen Thomas Stephen Thomas
Reply | Threaded
Open this post in threaded view
|

mopen command help needed

hi im a newuser to scilab..not much prior experience in any other equivalent software too

i want to open a file for reading a set of x y z values from scilab
i copeied the code frm
 

 http://spiff.rit.edu/classes/phys317/lectures/readwrite.html

Code

fid = mopen(filename, "r");
if (fid == -1)
error("cannot open file for reading");
end

to scipad editor and tried to execute via "Load into scilab" i had created an empty file in home directory named "filename "via gedit
before execution .
While execution says "Undefined variable 'filename'
then i changed the code to

fid = mopen("filename", "r");


ie added " " before and after filename then it executes..
what is the problem here i cant understand it...I just copied it as it is from
 http://spiff.rit.edu/classes/phys317/lectures/readwrite.html
Is the syntax used here is wrong??
Where should i get the correct syntax for the function mopen and other functions then?

i tried 'help mopen'
and it displayed

Calling sequence

[fd.err]=mopen( file [,mode ,swap])

Is this the proper syntax ?? I dont think so ,where should i get the corret sequence then?
somebody please help..
Thanks





--------------------------------------------------------------------------------------------------
 
"Be good, be kind, be humane, and charitable; love your fellows;
 
console the afflicted; pardon those who have done you wrong."
 
Zoroaster.



The Ubuntu Counter Project - user number # 22904

Francis Drossaert Francis Drossaert
Reply | Threaded
Open this post in threaded view
|

RE: mopen command help needed

Hi Stephen,

 

1. Make sure that the filename is correct. If your data file is called xyz.dat then the first command should be fid = mopen(‘xyz.dat’,’r’) or you do: filename  =  ‘xyz.dat’; fid =  mopen(filename,’r’);

2. Make sure that the data file is in the current working directory or make sure that the path is correct for example: fid = mopen(‘../data/xyz.dat’,’r’).

 

Cheers,

 

Francis

 

 

From: Stephen Thomas [mailto:[hidden email]]
Sent: 06 March 2009 04:20
To: [hidden email]
Subject: [scilab-Users] mopen command help needed

 

hi im a newuser to scilab..not much prior experience in any other equivalent software too

i want to open a file for reading a set of x y z values from scilab
 i copeied the code frm
 

 http://spiff.rit.edu/classes/phys317/lectures/readwrite.html

Code

 fid = mopen(filename, "r");
  if (fid == -1)
    error("cannot open file for reading");
  end

to scipad editor and tried to execute via  "Load into scilab" i had created an empty file in home directory named "filename "via gedit
before execution .
While execution says "Undefined variable 'filename'
then i changed the code to
 
fid = mopen(
"filename", "r");

ie added " " before and after filename then it executes..
what is the problem here i cant understand it...I just copied it as it is from
 http://spiff.rit.edu/classes/phys317/lectures/readwrite.html
Is the syntax used here is wrong??
Where should i
 get the correct syntax for the function mopen and other functions then?

i tried 'help mopen'
and it displayed

Calling sequence

[fd.err]=mopen( file [,mode ,swap])

Is this the proper syntax ?? I dont think so ,where should i get the corret sequence then?
 somebody please help..
Thanks




--------------------------------------------------------------------------------------------------

 

"Be good, be kind, be humane, and charitable; love your fellows;

 

console the afflicted; pardon those who have done you wrong."

 

Zoroaster.Image removed by sender.

 

Image removed by sender.

Image removed by sender. The Ubuntu Counter Project - user number # 22904

 

This email and any files contained therein is confidential and may contain privileged information. If you are not the named addressee(s) or you have otherwise received this in error, you should not distribute or copy this e-mail or use any of its content for any purpose. Please notify the sender immediately by e-mail if you have received this e-mail in error and delete it from your system
Stephen Thomas Stephen Thomas
Reply | Threaded
Open this post in threaded view
|

RE: mopen command help needed

Thank You Francis I got it

--------------------------------------------------------------------------------------------------
 
"Be good, be kind, be humane, and charitable; love your fellows;
 
console the afflicted; pardon those who have done you wrong."
 
Zoroaster.



The
 Ubuntu Counter Project - user number # 22904


--- On Fri, 3/6/09, Francis Drossaert <[hidden email]> wrote:
From: Francis Drossaert <[hidden email]>
Subject: RE: [scilab-Users] mopen command help needed
To: [hidden email]
Date: Friday, March 6, 2009, 2:55 PM

Hi Stephen,

 

1. Make sure that the filename is correct. If your data file is called xyz.dat then the first command should be fid = mopen(‘xyz.dat’,’r’) or you do: filename  =  ‘xyz.dat’; fid =  mopen(filename,’r’);

2. Make sure that the data file is in the current working directory or make sure that the path is correct for example: fid = mopen(‘../data/xyz.dat’,’r’).

 

Cheers,

 

Francis

 

 

From: Stephen Thomas [mailto:[hidden email]]
Sent: 06 March 2009 04:20
To: [hidden email]
Subject: [scilab-Users] mopen command help needed

 

hi im a newuser to scilab..not much prior experience in any other equivalent software too

i want to open a file for reading a set of x y z values from scilab

 i copeied the code frm

 


 http://spiff.rit.edu/classes/phys317/lectures/readwrite.html



Code



 fid = mopen(filename, "r");

  if (fid == -1)

    error("cannot open file for reading");

  end



to scipad editor and tried to execute via  "Load into scilab" i had created an empty file in home directory named "filename "via gedit

before execution .

While execution says "Undefined variable 'filename'

then i changed the code to

 

fid = mopen(
"filename", "r");



ie added " " before and after filename then it executes..

what is the problem here i cant understand it...I just copied it as it is from

 http://spiff.rit.edu/classes/phys317/lectures/readwrite.html

Is the syntax used here is wrong??

Where should i
 get the correct syntax for the function mopen and other functions then?



i tried 'help mopen'

and it displayed



Calling sequence



[fd.err]=mopen( file [,mode ,swap])



Is this the proper syntax ?? I dont think so ,where should i get the corret sequence then?

 somebody please help..

Thanks









--------------------------------------------------------------------------------------------------

 

"Be good, be kind, be humane, and charitable; love your fellows;

 

console the afflicted; pardon those who have done you wrong."

 

Zoroaster.Image removed by sender.

 

Image removed by sender.

Image removed by sender. The Ubuntu Counter Project - user number # 22904

 

This email and any files contained therein is confidential and may contain privileged information. If you are not the named addressee(s) or you have otherwise received this in error, you should not distribute or copy this e-mail or use any of its content for any purpose. Please notify the sender immediately by e-mail if you have received this e-mail in error and delete it from your system