??? Undefined function or variable 'PathName'.

  • Permalink
  • submit to reddit
  • Email
  • Follow


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
Reply wahyoe 3/24/2011 5:04:04 AM

See related articles to this posting

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
Reply 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
Reply 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
Reply 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
Reply 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
Reply wahyoe 3/24/2011 7:10:14 AM
comp.soft-sys.matlab 201095 articles. 512 followers. Post

5 Replies
188 Views

Similar Articles

[PageSpeed] 28


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

??? 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) 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 > ...

Undefined variable or function Dist might refer to the function dist.
I am using GA and anonymous function to solve my problem. However, i couldn't fix the error. Can anyone tell me what i did wrong? Here is the error: ??? Undefined variable or function Dist might refer to the function dist. Error in ==> Fitness at 19 OBJ = sum(sum(Dist))+sum(sum(Fix)); Error in ==> @(x)Fitness(x,ct,w,p,f) This is my Objective function: function OBJ = Fitness(x,ct,w,p,f) index=size(x); for i=[1:index(1,1)-1] for j=[1:index(1,2)] Dist(i,j)=ct(i,j)*w(i,j)*p(i,j)*x(i,j); end end for j=[1:index(1,2)] Fix(j)=f(j)*x(index(1),j); end OBJ = sum(sum...

Undefined variable or function error even though variable is defined
Hi guys I'm working on my final year project and At the moment i'm writing a code that it supposes to record 10 seconds of video into an avi file when something happens in the video. My problem is that even though i defined the AVI file, it gives me the following error: ??? Undefined function or variable "mov". Error in ==> ColorForegroundSegmentationB at 142 mov = close(mov) My piece of code looks something like this: area = bwarea(idi) for i= 1:p if area >= 20000 && area <= 40000 disp('Human object in sitting position') filename=['&#...

??? Undefined function or variable
I am going mad! I keep getting "??? Undefined function or variable" when I run the function calc_RSI. I have used "dir" and "path" and the file exists in both? Lommen wrote: > I am going mad! I keep getting "??? Undefined function or variable" > when I run the function calc_RSI. > > I have used "dir" and "path" and the file exists in both? Case mismatch, perhaps??? ML is case-sensitive in matching variable and function names. -- "Lommen " <lomme028@math.umn.edu> wrote in message <...

Variable is undefined: Actually a function
Still working on the same project as when I last posted an inquiry (the relevant detail would be that I did not write this code). I'm getting the following error at runtime: % Variable is undefined: CALCULATE_DECAY_RATE. % Execution halted at: PHYSIOLOGY::MTT % ESTIMATE_AIF_MRTM 283 ~/Developer/DCE-MRI ABC/MRTM/estimate_aif_mrtm.pro % ANALYZE_ROI_DATA_EVENT 582 ~/Developer/DCE-MRI ABC/ANALYSIS/analyze_roi_data.pro % WIDGET_PROCESS_EVENTS % $MAIN$ I've checked through PHYSIOLOGY::MTT, and it does...

undefined function or variable matlabrc
when I try to create a stand alone application by compiling my m.file (mcc) everything works fine.When I run it in another computer which has no matlab,the following error accured. Unable to find java library: C:\programs\matlab701\Myprogram\/sys/java/jre/win32/jre/bin/classic/jv m.dll After confirming the error it appears in the command window: Name is nonexistent or not a directory C:\programs\matlab701\Myprogram\toolbox\local undefined function or variable matlabrc I am using Matlab 7.0.1 and the m.file creates a gui and uses ToolBox(wavelet function) functions. Does anybody knows why...

undefined function or variable #5
I get 'undefined function or variable' error with any of my files (which I created myself, not toolbox files). Any idea what is wrong and how to fix it? Thanks, Evaldas Evaldas wrote: > I get 'undefined function or variable' error with any of my files > (which I created myself, not toolbox files). Any idea what is wrong > and how to fix it? ... More than likely you've stored them in a directory not in the Matlab search path doc path Alternatively, you've not named them properly-- help function and/or look in online documentation under "Names - Funct...

Undefined function or variable
Matlab has gone mad! It won't accept any declaration other than predeclared matlab functions (say, fft). Almost any other function call returns 'Undefined function or method bla bla'. I know you'll think that I don't have the path defined correctly, or that my function is not defined properly, but this is not the case. I am trying to call functions or script located in the directory i am currently browsing. Tab autocompletes their name when I start typing the first few letters. But as soon as I press enter, matlab gets confused. I have been using matlab for years, ne...

undefined function or variable #8
Dear all, I am new to matlab and got stuck with a problem---- undefined function or variable b. could any of you help me with it? thank you very much. my function is as follows; function [ p ] = RT( a ) %UNTITLED2 1-dimension rapid transformation % Detailed explanation goes here [m,n]=size(a); if n~=1 for i=1:n/2 b(i) = a(i) | a(i+n/2); c(i) = xor(a(i),~a(i+n/2)); end b=RT(b); c=RT(c); end p = [b,c]; end I have a feeling that the problem may be that b=RT(b) is not correct,but I am not sure and have no idea how to fix it. thank you again! Thank you ...

Undefined function or variable 392478
Hi, I've got a big problem. I'd like to use a MATLAB toolbox. All requirements are installed but it won't run. I open the main .m file (let's say it's called 'hello.m'). I press the runbutton at the top of the editor and it always says Undefined function or variable 'hello'. which hallo says: D:\directory\hallo.m % Has no license available And it's not even just that file, every file I create in that folder even if it contains just A = 2 or s.th. like that won't work. I added the Folder to the path, but the problem remains. O...