|
From: | Raghu ram, Posimsetti (P.) |
Subject: | RE: Default Path in Octave 4.2.1 |
Date: | Tue, 13 Mar 2018 08:10:48 +0000 |
Hello Ian, Thanks for your support. 1.
First one is syntax error correct one is ‘cd(pathdir)’ 2.
Added modified code
pathdir = fullfile(getenv('USERPROFILE'), 'Documents', 'OCTAVE'); if isdir(pathdir) cd(pathdir); else mkdir(pathdir); cd(pathdir); end even after above modification code is not setting current path as requested path. i observed that for a fraction code is setting current path as requested path
and after returning to default path. Is there any other file in package resetting the path? I need to set current Dir path while launching the tool. Even after changing code its showing the current dir path as where the installation files are Regards RaghuRam Posimsetti Int: +91-44-6655-6124 FordNet:- 8-357-6124 From: Ian McCallion [mailto:address@hidden
On Mon, 12 Mar 2018, 20:26 Raghu ram, Posimsetti (P.), <address@hidden> wrote:
1.This cannot be the code that worked under 4.0.3 as cd(getenv(pathdir); is a syntax error. Did you mean cd (pathdir); 2. Also it is poor practice to use strcat to construct paths. Use fullfile instead as this deals automatically with the path separator. pathdir = fullfile('C:\Users', cdsid, 'Documents\OCTAVE'); 3. Finally getenv('USERPROFILE') returns the user's home directory directly so pathdir = fullfile(getenv('USERPROFILE'), 'Documents', 'OCTAVE'); would be the preferred way of doing what you want. I don't know what your bug is but fix the above 3 points first and report back if still not working. Cheers... Ian |
[Prev in Thread] | Current Thread | [Next in Thread] |