f



??? Undefined function or variable 'PathName'.

hi all
Can you help provide solutions
I tried to call data from txt file

disp(input('input, press enter'))
[FileName.PathName]=uigetfile(('*.txt'), 'browser file')
fileToRead=fullfile(PathName,FileName)
propil=importdata(fileToRead)



FileName = 

    PathName: 'prop.txt'

??? Undefined function or variable 'PathName'.

Error in ==> input_data_t3d at 4
fileToRead=fullfile(PathName,FileName)
0
wahyoe
3/24/2011 5:04:04 AM
comp.soft-sys.matlab 211075 articles. 13 followers. lunamoonmoon (258) is leader. Post Follow

5 Replies
499 Views

Similar Articles

[PageSpeed] 36

On 3/23/2011 10:04 PM, wahyoe Unggul wrote:
> hi all
> Can you help provide solutions
> I tried to call data from txt file
>
> disp(input('input, press enter'))
> [FileName.PathName]=uigetfile(('*.txt'), 'browser file')
> fileToRead=fullfile(PathName,FileName)
> propil=importdata(fileToRead)
>
>
>
> FileName =
>
>      PathName: 'prop.txt'
>
> ??? Undefined function or variable 'PathName'.
>
> Error in ==>  input_data_t3d at 4
> fileToRead=fullfile(PathName,FileName)


Change the '.' to ','  in this line between the FIleName and PathName


[FileName.PathName]=uigetfile(('*.txt'), 'browser file')


--Nasser

0
Nasser
3/24/2011 5:17:14 AM
"Nasser M. Abbasi" <nma@12000.org> wrote in message <imek4v$l3o$1@speranza.aioe.org>...
> On 3/23/2011 10:04 PM, wahyoe Unggul wrote:
> > hi all
> > Can you help provide solutions
> > I tried to call data from txt file
> >
> > disp(input('input, press enter'))
> > [FileName.PathName]=uigetfile(('*.txt'), 'browser file')
> > fileToRead=fullfile(PathName,FileName)
> > propil=importdata(fileToRead)
> >
> >
> >
> > FileName =
> >
> >      PathName: 'prop.txt'
> >
> > ??? Undefined function or variable 'PathName'.
> >
> > Error in ==>  input_data_t3d at 4
> > fileToRead=fullfile(PathName,FileName)
> 
> 
> Change the '.' to ','  in this line between the FIleName and PathName
> 
> 
> [FileName.PathName]=uigetfile(('*.txt'), 'browser file')

hai nasser
thanks Thank you very much
> 
> 
> --Nasser
0
wahyoe
3/24/2011 5:35:20 AM
hai nasser
why at the time of data occur as a result used below

C:\Documents and Settings\W@hyOe\My Documents\MATLAB\eploitasi\data input\prop.txt


prop =

  1.0e+005 *

    0.0000    2.1000    0.0045         0    0.0000
    0.0000    2.2000    0.0080         0    0.0000
    0.0000    2.6000    0.0050         0    0.0000
    0.0000    2.8000    0.0070         0    0.0000


ans =

prop.txt

>> C=prop'
??? Undefined function or variable 'prop'.
0
wahyoe
3/24/2011 6:23:04 AM
On 3/23/2011 11:23 PM, wahyoe Unggul wrote:
> hai nasser
> why at the time of data occur as a result used below
>
> C:\Documents and Settings\W@hyOe\My Documents\MATLAB\eploitasi\data input\prop.txt
>
>
> prop =
>
>    1.0e+005 *
>
>      0.0000    2.1000    0.0045         0    0.0000
>      0.0000    2.2000    0.0080         0    0.0000
>      0.0000    2.6000    0.0050         0    0.0000
>      0.0000    2.8000    0.0070         0    0.0000
>
>
> ans =
>
> prop.txt
>
>>> C=prop'
> ??? Undefined function or variable 'prop'.

I do not understand.

PLease post COMPLETE working code, from the start to the end. Not
just a fragment.

--Nasser
0
Nasser
3/24/2011 6:39:06 AM
data file txt 

1  2.10e5   450   0   7.85e-5
2  2.20e5   800   0   7.85e-5
3  2.60e5   500   0   7.85e-5
4  2.80e5   700   0   7.85e-5

function [data,f2r,prop,prop2] = input_data_t3d
disp(input('input, press enter'))
[data,directory]=uigetfile({'*.txt';'*.dat';'*.mat';'*.rtf';'*.*'},'File Selector')
f2r=fullfile(directory,data)
prop=(importdata(f2r))

output

input, press enter

data =

coord.txt


directory =

C:\Documents and Settings\W@hyOe\My Documents\MATLAB\eploitasi\data input\


f2r =

C:\Documents and Settings\W@hyOe\My Documents\MATLAB\eploitasi\data input\coord.txt


prop =

  1.0e+003 *

    0.0010         0         0    4.2426
    0.0020    4.2426         0    4.2426
    0.0030    4.2426         0         0
    0.0040         0         0         0
    0.0050    2.1213    4.0000    2.1213

if data is "prop" I use for subsequent calculations,
then the variable is not recognized

>> C=prop.*2
??? Undefined function or variable 'prop'.
0
wahyoe
3/24/2011 7:10:14 AM
Reply: