input arguments must be scalar matlab error

12 views (last 30 days)
SAURABH KUMAR
SAURABH KUMAR on 4 Mar 2015
Moved: DGM on 14 Feb 2023
I have written a code in it is telling above error in part mentioned below
NB=max(size(Y));
H=zeros(2:NB,2:NB);
N=zeros(NG+1:NB,NG+1:NB);
L=zeros(2:NB,NG+1:NB);
M=zeros(NG+1:NB,2:NB);
Plz. reply fast
  2 Comments
Jan
Jan on 5 Mar 2015
Edited: Jan on 5 Mar 2015
Please post the complete error message. Most of all the line, which causes the error, would be nice to know.
And before posting the error message, read it carefully. "The inputs arguments must be scalar". Are the used inputs arguments scalars?
SAURABH KUMAR
SAURABH KUMAR on 5 Mar 2015
Moved: DGM on 14 Feb 2023
COMPLETE ERROR MESSAGE; Warning: Input arguments must be scalar. > In harmonic_load_flow at 145 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 145 In HLFA at 8 Elapsed time is 0.001287 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 146 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 146 In HLFA at 8 Elapsed time is 0.000892 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 147 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 147 In HLFA at 8 Elapsed time is 0.000759 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 148 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 148 In HLFA at 8 Elapsed time is 0.000757 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 145 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 145 In HLFA at 8 Elapsed time is 0.000769 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 146 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 146 In HLFA at 8 Elapsed time is 0.000687 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 147 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 147 In HLFA at 8 Elapsed time is 0.000747 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 148 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 148 In HLFA at 8 Elapsed time is 0.000836 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 145 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 145 In HLFA at 8 Elapsed time is 0.000862 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 146 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 146 In HLFA at 8 Elapsed time is 0.001222 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 147 In HLFA at 8 Warning: Input arguments must be scalar. > In harmonic_load_flow at 147 In HLFA at 8 Elapsed time is 0.001227 seconds. Warning: Input arguments must be scalar. > In harmonic_load_flow at 148 In HLFA at 8

Sign in to comment.

Answers (1)

Guillaume
Guillaume on 4 Mar 2015
doc zeros
And look at the examples
  6 Comments
Temesgen Gelaw
Temesgen Gelaw on 27 Apr 2016
Moved: DGM on 14 Feb 2023
Instead of H=zeros(2:NB,2:NB) use H=zeros([2:NB 2:NB])
Walter Roberson
Walter Roberson on 28 Apr 2016
Moved: DGM on 14 Feb 2023
No, it would be either
H = zeros(NB, NB);
or
H = zeros(NB-2+1, NB-2+1);

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!