Tgspcread function error (line 323)

9 vues (au cours des 30 derniers jours)
Katherine
Katherine le 12 Fév 2019
Commenté : Arthur Goldsipe le 15 Fév 2019
I am attempting to use the tgspcread function in the Bioinformatics Toolbox to read a .spc file containing multiple spectra, but am receiving the following message. It had been working previous to updates to MATLAB, does anyone know how to solve it? Unfortunately my coding knowledge is pretty basic!
>> tgspcread('new.spc')
Reading header for file: new.spc
File contains 12826 scans
Insufficient number of outputs from right hand side of equal sign to satisfy assignment.
Error in tgspcread (line 323)
outputHeader.FileSize = dirInfo.bytes;

Réponses (1)

Arthur Goldsipe
Arthur Goldsipe le 12 Fév 2019
I think this is a bug in how the function tries to find out the size of the SPC file. You will see this error if the file is located in a folder that was added to MATLAB's path. The function fopen that opens the file is able to locate files on the MATLAB path, but the function dir that gives file information does not find files on the MATLAB path.
One solution is to change your current working directory to the folder that contains the SPC file before running the command. Another solution would be to specify the relative or absolute path to the file when you call tgspcread. For example, if you're using Linux, and the file is in the /tmp folder, you could update your line of code to tgspcread('/tmp/new.spc').
  8 commentaires
Ewan Hislop
Ewan Hislop le 14 Fév 2019
Thank you! This has been driving me mad all day. :)
Arthur Goldsipe
Arthur Goldsipe le 15 Fév 2019
Hi Ewan,
This is getting outside the scope of the original question, and it's a bit hard to follow along via comments. (It also makes it harder for other people with similar problems to find the solutions.) I recommend you make a new post in MATLAB Answers. If possible, I suggest attaching any relevant files so that other people can try to reproduce the problem.
-Arthur

Connectez-vous pour commenter.

Catégories

En savoir plus sur Bioinformatics Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by