Problem using cd in MATLAB function
Mostrar comentarios más antiguos
Hi, I'm writing a MATLAB function that needs to change directories, but I keep getting this error:
Error in GetStations (line 5)
home = cd;
Here is part of my function:
function [Stations,NumStations] = GetStations(NLat,SLat,ELon,WLon)
% This function searches a list of seismic stations for those within the geographic box specified by the input latitudes and longitudes.
home = cd; % Where I'm currently working
% Go to where the seismic station list is saved:
cd('C:\Users\User\Desktop\Research\MATLABFunctions');
StationList = fopen('Stations.txt'); % Open text file
% Read file, skip first line:
AllStations = textscan(StationList, '%s %s %f %f','headerlines', 1);
fclose(StationList); % Close text file
cd(home); % Go back to where I'm currently working
1 comentario
Walter Roberson
el 27 de Jul. de 2015
Please show the complete error message.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Geographic Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!