plz help me in resolving the error.
Error: Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.
128 views (last 30 days)
Show older comments
Commented: Azariah Seblu on 19 Jul 2021
Error evaluating 'InitFcn' callback of block_diagram 'DFIG_SMC'. Callback string is '% Parametrs for DFIG with SMC
% Parametrs for DFIG with SMC
%% Maximum and Minimum wind speeds
%% Three Blade wind turbine model
%% Cp and Ct curves
%% Kopt for MPPT
%% Torque and speed inputs
%% Grid side converter
%% Mechanical Inputs
- Error: Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.
Azariah Seblu on 19 Jul 2021
Thank you @John D'Errico for the excellent, detailed response. You are very good with MATLAB! Hope to see you around the forum in the future!
Walter Roberson on 20 Jul 2020
Apostrophe cannot be part of a variable name in MATLAB Function Block or Callbacks.
More Answers (1)
John D'Errico on 20 Jul 2020
A simple rule in MATLAB: You cannot assign a result to a result.
What is Rr' then? This is the conjugate transpose of the array or vector Rr. MATLAB does not truly care that Rr is apparently a scalar.
My guess is you wanted to name a variable like that. Sorry, but Rr' is not a valid variable name. So, what error arises? MATLAB thinks the left hand side is the conjugate transpose of something called Rr, that is, it sees the result of an operation. Therefore, it thinks you may want to compare the two results for equality, thus the error message.
Find more on Startup and Shutdown 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!