??? 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 207273 articles. 1 followers. lunamoonmoon (258) is leader. Post Follow

5 Replies
287 Views

Similar Articles

[PageSpeed] 17
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:
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=['&#...

Function pointers, variable argument functions calling other variable-argument functions (sort of)
Hi I have been searching the web and comp.lang.c of a method of using variable-argument function pointers and the like. And some of the questions arising in this post are answered partly in these posts, but I ask mainly for a way to found a way to solve this problem. I'm a hobbyist so there might be an alltogether better solution to the problem, so please come with any solution you might think of. I'm open to ideas. --- And i'm not bound by C. Suggestions from C++ are welcome. I need an extensible multithreaded application (i'm thinking windows here since I have no experience...

??? 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 argument function as a parameter of a variable argument function
Hi everyone, I've done a little searching, but I can't quite find an answer to my question. Everything I've found is more related to how to construct a variable argument function, and that's not my question. Suppose I have a variable argument function. Is it possible to use it to initialize a parameter of another variable argument function? For example, printf("%s", varArgFcnReturningAString(a,b,c)); I ask because I'm not sure if this is supported by the standard and/or could be compiler specific. Thank you for any help, tips, and suggestions! On 11/20/201...

Variable variables in function
Everything works fine if I don't use this as a function and just place it inside my code. When I use it as a function it will return the variables that are in the "else" portion, but not the if statement. I can see the variables and echo them inside the function, but not outside of it, but just on the "if" portion, the "else" part is working fine. I must be missing something here, any help would be appreciated! function SetSessionVars ($postresults) { foreach ($postresults as $key => $val) { if (is_array($val)) { foreach ($val as $subkey =>...

how do I create nested functions, or functions of functions of a variable
I want to use Scilab to solve a function (E(n,t)) of two separate functions (n(T) and t(T)), which are both functions of the variable T. T will range from 122 to 300 in integer values [I would also like to know how to do this or create a list of scalars which can be inputted for T]. The "&#151;&#151;&#151;&#151;&#151;&#151;" means divided by. Notice that I must use the constant "e" and powers. I'd appreciate any help. If you could send a sample of code as well, that would probably help. Thanks in advance. Spyder #1: ...

Put variables into member variables or function variables?
I modify my code into following sample code. CTest is a class only constructed once when the device power on. CTest::ExecuteRunState is a function entered periodically. Do you think whether it is necessary to put the local variables into class private members? Otherwise, each time entering the ExecuteRunState(), those local variables will be decleared and initionalized one time. It's a waste of cpu resource. class CTest { public: CTest(); ~CTest(); private: void CTest(const CTest & m_CTest); void ExecuteRunState(); //This function will entered periodically ...

How to pass a function to a function?, and how to pass the variables of the function?
I'd like to write a function like: function f(){ ... bla ...} f_example(f); function f_example($function_to_execute) {...bla... $function_to_execute() ...bla....} AND how to pass the variable of the function : function f_example($function_to_execute($var1,$var2)) {...bla... $function_to_execute() ...bla....} Thank you in advance for the time you'll spend for me, Andrea. I'm sorry, I don't quite understand what you are asking... If you are asking how to use results of a function in another function then you should do this. function test1() { return "Hello Wor...

Undefined function or variable #6
Hello, Can anyone help please? I am working with the Monte Carlo output .2pt extension files. There is a function which can read those files in Matlab. "[data,seg] = loadMC2pt(filename);" but when I substitute the filename with my output file (s1), the program gives an error: "Undefined function or variable 's1'". All the paths are set. Thanks Irina Irina Schelkanova <irina.schelkanova@gmail.com> wrote in message <6286ef90-8070-49a8-8317-65dd9e0d099d@googlegroups.com>... > Hello, > > Can anyone help please? > > I am ...

??? Undefined function or variable #3
I'm trying to use the statistics toolbox but am so far unable to get a single function to work. I have confirmed that I have a license for the toolbox and all the m-files are installed on my computer. The toolbox is also specified in my Matlab path /Applications/MATLAB_R2007b/toolbox/stats, and I have tried calling the function directly from within the toolbox directory, all to no avail. For example: >> cd toolbox/stats/ >> nu = 1:6; >> x = nu; >> y = chi2pdf(x,nu) ??? Undefined function or method 'chi2pdf' for input arguments of type 'double'. Any...

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

Inline Function and undefined variable
Hi I am quite new to Matlab and strugglin on a daily basis with several problems in Matlab. But this problem remains now for a long time unsolved: Ihave defined the following function: function f=fun(x) f=inline('det(A-x*eye(7))','x'); end A is a 7x7 Matrix which is defined in the Workspace. When I now try to test this function with feval e.g.: feval(fun,3) I get the the folllowing errors: ??? Error using ==> inlineeval at 15 Error in inline expression ==> det(A-x*eye(7)) Undefined function or variable 'A'. Error in ==> inline.feval ...

error : undefined variable or function
I am defining the function as follows: function data = spikedata(filename) and the rest of the function is as follows: f = fopen(filename,'r'); ; ; ; ; then when i evaluate from the f = fopen(filename,'r') section. it gives me the following error Undefined function or variable filename balu@ou.edu (Bala) wrote in news:mhwfanilnlxx@legacy: > I am defining the function as follows: > > function data = spikedata(filename) > > and the rest of the function is as follows: > > f = fopen(filename,'r'); > > ; > ; > ; > ; > &...

Undefined function or variable #4
Hi, I am trying to run a very simple function in Matlab that I have named get_max. When I type ls or dir, I can see the function file in the directory listing and I can open the file in the ''Current directory'' window, but when I type get_max in the command window, I keep getting the ''Undefined function or variable'' message. I've tried creating a new file and copying the code to it, but it still won't run. I really don't understand what's going on here... Thanks for your help. Phil On Mon, 26 Feb 2007 17:28:20 -0500, Phil wrote: > Hi, &...

Undefined function or variable #3
I get into trouble using a function 'apply' >> which apply /home/datareduction/@normalizer/apply.m So Matlab knows which 'apply' I am talking about. But, here is the problem: >> apply ??? Undefined function or variable 'apply'. Why would this happen? Any suggestions? Is it because it resides in a very special directory with a '@'? Thanks! On Fri, 21 Jul 2006 09:31:43 -0700, b83503104@yahoo.com wrote: > I get into trouble using a function 'apply' > >>> which apply > /home/datareduction/@normalizer/apply.m > >...

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 415817
I am trying to write some data to a file but I keep getting the following message; ??? Undefined function or variable 'lot'. When I declare the variable it is in a script. However, after getting the error message, if I type 'lot' in the command prompt the variable is recognised. Any ideas as to why this would be happening? "David " <daithi62@gmail.com> wrote in message <iecd2d$ofg$1@fred.mathworks.com>... > I am trying to write some data to a file but I keep getting the following message; > ??? Undefined function or variable 'lot&...

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
after one week working with a script and function and getting result of running, just today it didn't work well. I just got this error: "Undefined function or method 'MSVmea' for input arguments of type 'double' while it was working well before. I was trying to get into iterations in lsqnonlin optimization which this happened to the program. it seems it can not find the path of function which I tried to locate those in the same directory. thats frustrating now for me as it was almost done for me before. any help will be appreciated "Maria " <mr7...

Undefined function or variable error
When the code below is run, it complains about ??? Undefined function or variable 'q'. What could be causing this? function rd q = input('Enter the value of epsilon > '); h = 0.01; p=input('Enter the value for p > '); final_time=input('Enter the value for maximum time > '); final = final_time*2/h; a_old =zeros(2,1); a=zeros(3,1); b_old=zeros(2,1); b=zeros(3,1); u=zeros(3,1); time=zeros(2*final,1); dist=zeros(2*final,1); v=zeros(2*final-1,1); position=zeros(3,1); %Solve the equations on the characteristic span=linspace(0,final_time,final); [eta,b_b]=...

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

Calling a function that expects variable arguments from a function with variable arguments
I am writing a dynamically growing string buffer. The following struct represents a string buffer. struct strbuf { char *buffer; /* null terminated buffer */ size_t length; /* length of the string excluding null terminator */ size_t allocated; /* total memory allocated */ }; I have also got several functions to operate on this. The following function takes a format and formats it using "vsnprintf" and adds to the buffer. int strbuf_addf(struct strbuf *string, const char *format, ...) { size_t space_available; int len...

problem with: ??? Undefined function or variable
Hi, I have a m.file and the code works perfectly if I type it in the command window. Whenever I try to run the script I get the error message: ??? Undefined function or variable. My working directory containing the m.file plus data is included in the Matlab Path, so this cannot be the problem. Does anyone know what might cause the problem? "Hedwig Schnee" <astrid.meyer@yahoo.de> wrote in message <ictlmg$hqj$1@fred.mathworks.com>... > Hi, > I have a m.file and the code works perfectly if I type it in the command window. Whenever I try to run the script I ...