Error: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

7 ビュー (過去 30 日間)
function PruebasdisponiblesButtonGroupSelectionChanged(app, event)
switch app.PruebasdisponiblesButtonGroup.SelectedObject.Text
case 'PBU'
if app.FuncinDropDownLabel == "Pwf"
app.UIAxes.YLabel.String = 'Pwf';
app.UIAxes2.YLabel.String = 'Pwf';
app.UIAxes3.YLabel.String = 'Pwf';
elseif app.FuncinDropDownLabel == "m(p)"
app.UIAxes.YLabel.String = 'm(p)';
app.UIAxes2.YLabel.String = 'm(p)';
app.UIAxes3.YLabel.String = 'm(p)';
elseif app.FuncinDropDownLabel == "P^2"
app.UIAxes.YLabel.String = 'P^2';
app.UIAxes2.YLabel.String = 'P^2';
app.UIAxes3.YLabel.String = 'P^2';
end
case 'PDD'
if app.FuncinDropDownLabel == "Pwf"
app.UIAxes.YLabel.String = 'Pwf';
app.UIAxes2.YLabel.String = 'Pwf';
app.UIAxes3.YLabel.String = 'Pwf';
elseif app.FuncinDropDownLabel == "m(p)"
app.UIAxes.YLabel.String = 'm(p)';
app.UIAxes2.YLabel.String = 'm(p)';
app.UIAxes3.YLabel.String = 'm(p)';
elseif app.FuncinDropDownLabel == "P^2"
app.UIAxes.YLabel.String = 'P^2';
app.UIAxes2.YLabel.String = 'P^2';
app.UIAxes3.YLabel.String = 'P^2';
end
end
end
end
end
% Component initialization
methods (Access = private)
[SL: formatted code as code]
  3 件のコメント
Juan José Jiménez
Juan José Jiménez 2020 年 10 月 12 日
It occurs on the last line, the one that says methods (Acces = private)
Juan José Jiménez
Juan José Jiménez 2020 年 10 月 12 日
Parse error at methods: usage might be invalid MATLAB syntax

サインインしてコメントする。

採用された回答

Steven Lord
Steven Lord 2020 年 10 月 12 日
Smart indent your code in the MATLAB Editor. When I did that for your code sample, there were two end statements after the one that matched the function keyword. Assuming that this is a method in a classdef file the first of those end statements would end the methods block in which that method was defined and the second would end the classdef block. This means the new methods block that you're trying to start falls outside the class definition.
Eliminate the last of those end statements or move it to the end of the class definition.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by