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 view (last 30 days)
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.

Accepted Answer

Cris LaPierre
Cris LaPierre on 22 Jan 2021
Edited: Cris LaPierre on 22 Jan 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.

More Answers (1)

Steven Lord
Steven Lord on 23 Jan 2021
See my answer on this question.

Categories

Find more on Creating and Concatenating Matrices 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!