What Shall I need to add while calling file having numerical digits (e.g. -1,-2)?

1 次查看(过去 30 天)
% Calculation of PGA Values for Individual Earthquake
load Histories/IND.X0kY-1k.CXY.sema;
PGA_EQ(1,1) = max(IND.X0kY-1k.CXY(:,1));
But it shows a different error.
>>>>>> "Unexpected MATLAB expression"

采纳的回答

Walter Roberson
Walter Roberson 2021-3-28
To create the variable name, load precedes any leading underscores or digits in filename with an X and replaces any other nonalphabetic characters with underscores
So IND.X0kY-1k.CXY.sema would result in the creation of variable named IND_X0kY_1k_CXY (file extension is removed)

更多回答(1 个)

the cyclist
the cyclist 2021-3-28
编辑:the cyclist 2021-3-28
You may want to try the functional form instead.
load('Histories/IND.X0kY-1k.CXY.sema');
Also, what variables are in your workspace after loading? You will not have a variable named IND.X0kY-1k.CXY (which it seems you are trying to use), because that is not a valid variable name.

类别

Help CenterFile Exchange 中查找有关 Geology 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by