Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
??? Undefined function or variable 'PathName'.

Subject: ??? Undefined function or variable 'PathName'.

From: wahyoe Unggul

Date: 24 Mar, 2011 05:04:04

Message: 1 of 6

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)

Subject: ??? Undefined function or variable 'PathName'.

From: Nasser M. Abbasi

Date: 24 Mar, 2011 05:17:14

Message: 2 of 6

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

Subject: ??? Undefined function or variable 'PathName'.

From: wahyoe Unggul

Date: 24 Mar, 2011 05:35:20

Message: 3 of 6

"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

Subject: ??? Undefined function or variable 'PathName'.

From: wahyoe Unggul

Date: 24 Mar, 2011 06:23:04

Message: 4 of 6

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'.

Subject: ??? Undefined function or variable 'PathName'.

From: Nasser M. Abbasi

Date: 24 Mar, 2011 06:39:06

Message: 5 of 6

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

Subject: ??? Undefined function or variable 'PathName'.

From: wahyoe Unggul

Date: 24 Mar, 2011 07:10:14

Message: 6 of 6

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'.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us