Problem reading an excel csp file using Matlab

3 views (last 30 days)
Please help ! I wrote a matlab code to compute Position Velocity and Time in GPS but we have problem reading our data in the Excel CSP file ..
This is my code:
function eph = get_eph(ephemeridesfile) %GET_EPH The ephemerides contained in ephemeridesfile % are reshaped into a matrix with 21 rows and % as many columns as there are ephemerides.
% Typical call eph = get_eph('rinex_n.dat')
%Kai Borre 10-10-96 %Copyright (c) by Kai Borre %$Revision: 1.0 $ $Date: 1997/09/26 $
fide = fopen(ephemeridesfile); [eph, count] = fread(fide, Inf, 'double'); noeph = count/21; eph = reshape(eph, 21, noeph);
This is my error:
Error using fread Invalid file identifier. Use fopen to generate a valid file identifier.
Error in get_eph (line 13) [eph, count] = fread(fide, Inf, 'double');
Error in loadingscript (line 14) eph = get_eph(ephemeridesfile);

Answers (1)

Matt Tearle
Matt Tearle on 18 Feb 2014
The error message is indicating a problem with opening the file. The file identifier returned by fopen does not refer to a valid, open file. That would generally indicated that the file doesn't exist or is corrupted. For example:
>> fid = fopen('nosuchfile.xyz')
fid =
-1
>> fread(fid)
Error using fread
Invalid file identifier. Use fopen to generate a valid file identifier.

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!