How to solve this issue :Error: File: FormatDataNew.m Line: 1 Column: 59 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parenthese

1 visualizzazione (ultimi 30 giorni)
the error seems to come from this line:
function [dat_AP,Amp_AP,Ph_AP,Fs_AP,TD_P] = FormatDataNew('moh.txt')
please explain what could be the problem.

Risposta accettata

Cris LaPierre
Cris LaPierre il 22 Gen 2021
Modificato: Cris LaPierre il 22 Gen 2021
This appears to be your function declaration line. If so, appear to have declared it using the calling syntax. You should replace 'moh.txt' with a variable name (no quotes).
function [dat_AP,Amp_AP,Ph_AP,Fs_AP,TD_P] = FormatDataNew(file)
Then in your script when you call your function, that is when you use the actual file name.
[dat_AP,Amp_AP,Ph_AP,Fs_AP,TD_P] = FormatDataNew('moh.txt');
See this page for more on declaring functions.

Più risposte (1)

Steven Lord
Steven Lord il 23 Gen 2021
See my answer on this question.

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by