Answered

Dimensions of matrices being concatenated are not consistent.

See: Debug a MATLAB Program and Examine Values While Debugging and TUTORIAL: how to ask a question (on Answers) and get a fast...

Dimensions of matrices being concatenated are not consistent.

See: Debug a MATLAB Program and Examine Values While Debugging and TUTORIAL: how to ask a question (on Answers) and get a fast...

11 hours ago | 1

| accepted

Answered

Add toolbox to MATLAB manually

"Is it possible to use it for the 2018 version" most likely "license is needed for this product" no it's free to use Insta...

Add toolbox to MATLAB manually

"Is it possible to use it for the 2018 version" most likely "license is needed for this product" no it's free to use Insta...

11 hours ago | 1

Answered

Error using + Matrix dimensions must agree.

Observation: for t1=1:length(y(1)) for t2=1:length(y(2)) Why loops? The length of one element is always ONE. I m...

Error using + Matrix dimensions must agree.

Observation: for t1=1:length(y(1)) for t2=1:length(y(2)) Why loops? The length of one element is always ONE. I m...

1 day ago | 0

Answered

I want an if-else statement to check whether the a part of the input is a decimal or not? The following program gave an error for input (2.3, 4, 5, 6)

I get a warning (not an error) and that's because 2.3 isn't an integer. >> day_diff( 2.3, 4, 5, 6 ); Warning: Intege...

I want an if-else statement to check whether the a part of the input is a decimal or not? The following program gave an error for input (2.3, 4, 5, 6)

I get a warning (not an error) and that's because 2.3 isn't an integer. >> day_diff( 2.3, 4, 5, 6 ); Warning: Intege...

3 days ago | 0

Answered

How to create an structure fields from an cell array?

The old way %% namesoftags = {'timeaxis','cputime','flux','volts'}; data1 = [ 1,5,298,53 2,9,284,35 3,0...

How to create an structure fields from an cell array?

The old way %% namesoftags = {'timeaxis','cputime','flux','volts'}; data1 = [ 1,5,298,53 2,9,284,35 3,0...

3 days ago | 0

Answered

Having trouble with "Index exceeds the number of array elements (1)" error

The error occur in the line M=line([0,L1*cosd(angt1r(k)),x(k)],[0,L1*sind(angt1r(k)),y(k)]); Here the variables angt1r, x ...

Having trouble with "Index exceeds the number of array elements (1)" error

The error occur in the line M=line([0,L1*cosd(angt1r(k)),x(k)],[0,L1*sind(angt1r(k)),y(k)]); Here the variables angt1r, x ...

3 days ago | 1

| accepted

Answered

Example for marine vessel energy system

There was a similar question a couple of weeks ago. See my answer. On my system open_system('pe_marine_electrical_system'); w...

Example for marine vessel energy system

There was a similar question a couple of weeks ago. See my answer. On my system open_system('pe_marine_electrical_system'); w...

3 days ago | 0

Answered

Undefined function or variable 'profile'.

Documentation says: MATLAB® Compiler™ supports the full MATLAB language and almost all toolboxes based on MATLAB except: Mos...

Undefined function or variable 'profile'.

Documentation says: MATLAB® Compiler™ supports the full MATLAB language and almost all toolboxes based on MATLAB except: Mos...

4 days ago | 0

| accepted

Answered

how to find the square of the number

This produces something that is close to the result you want %% x(:,3)=[2;3;4;5;6]; len = size(x,1); y = nan( len-1, 1 ); f...

how to find the square of the number

This produces something that is close to the result you want %% x(:,3)=[2;3;4;5;6]; len = size(x,1); y = nan( len-1, 1 ); f...

4 days ago | 0

| accepted

Answered

How to create a login interaface with a mask password

Search the FileExchange for password gui and see Get Authentication and Password & spinner controls in Matlab GUI

How to create a login interaface with a mask password

Search the FileExchange for password gui and see Get Authentication and Password & spinner controls in Matlab GUI

5 days ago | 0

| accepted

Answered

Not enough input arguments

abs and max are Matlab functions, which requires input. Thus disp(abs) disp(max) are wrong. What did you intend?

Not enough input arguments

abs and max are Matlab functions, which requires input. Thus disp(abs) disp(max) are wrong. What did you intend?

5 days ago | 0

Answered

VERY URGENT::::: My code is giving me this error: Index in position 2 is invalid. Array indices must be positive integers or logical values. Can you please resolve this for me? It is very urgent and due in two days!!!

See Debug a MATLAB Program Examine Values While Debugging

VERY URGENT::::: My code is giving me this error: Index in position 2 is invalid. Array indices must be positive integers or logical values. Can you please resolve this for me? It is very urgent and due in two days!!!

See Debug a MATLAB Program Examine Values While Debugging

7 days ago | 0

Answered

Matlab floating point problem

The script %% x = rotx(45*pi/180)*[1 2 3]'; y = rotx(-45*pi/180)*x; is1 = abs((y-[1;2;3])<eps(10)) returns is1 = 1 ...

Matlab floating point problem

The script %% x = rotx(45*pi/180)*[1 2 3]'; y = rotx(-45*pi/180)*x; is1 = abs((y-[1;2;3])<eps(10)) returns is1 = 1 ...

7 days ago | 0

Answered

I need a Wind turbine simulation model using Statcom and grid connection. Is there anyone to help me out?

Search the File Exchange for wind turbine simulink

I need a Wind turbine simulation model using Statcom and grid connection. Is there anyone to help me out?

Search the File Exchange for wind turbine simulink

7 days ago | 0

| accepted

Answered

Extract some data from a cell

This typically happend when reading a text file with textscan. A simple solution is to insert datelist = datelist{1}; before...

Extract some data from a cell

This typically happend when reading a text file with textscan. A simple solution is to insert datelist = datelist{1}; before...

7 days ago | 0

| accepted

Answered

joining string variables in a table with strjoin and rowfun

Replace rowfun(@(aa, bb) {strjoin({aa,bb}, '_')}, T, 'InputVariables', {'b', 'c'}) by rowfun( @(aa,bb) {strjoin([aa,bb],'_')}...

joining string variables in a table with strjoin and rowfun

Replace rowfun(@(aa, bb) {strjoin({aa,bb}, '_')}, T, 'InputVariables', {'b', 'c'}) by rowfun( @(aa,bb) {strjoin([aa,bb],'_')}...

8 days ago | 0

Answered

How to get the sum of numbers below a desired number in sets?

"data is very big" How big is that? Does it fit in the memory? Test this function function b = cssm( a ) %{ b =...

How to get the sum of numbers below a desired number in sets?

"data is very big" How big is that? Does it fit in the memory? Test this function function b = cssm( a ) %{ b =...

8 days ago | 0

Answered

How to qpsk a text file containing hexadecimal data of an image

See comm.QPSKModulator System object

How to qpsk a text file containing hexadecimal data of an image

See comm.QPSKModulator System object

11 days ago | 0

Answered

how to menchester encode or qpsk a text file

Replacing LoRa_Menchester_Decoding(menchester_output); by Menchester_Decoding(menchester_output); makes the code run withou...

how to menchester encode or qpsk a text file

Replacing LoRa_Menchester_Decoding(menchester_output); by Menchester_Decoding(menchester_output); makes the code run withou...

11 days ago | 1

| accepted

Answered

Where to get tutorial models

I copied and run your statement. After a few seconds the Simulink window with the model appeared. I'm at a university and Mat...

Where to get tutorial models

I copied and run your statement. After a few seconds the Simulink window with the model appeared. I'm at a university and Mat...

11 days ago | 0

Answered

Take the nanmean of every four points in a dataset.

"I need to get hourly averages of this [15-min] data set which also contains nans" Old time approach %% data_set = randn(109,...

Take the nanmean of every four points in a dataset.

"I need to get hourly averages of this [15-min] data set which also contains nans" Old time approach %% data_set = randn(109,...

11 days ago | 0

Answered

multiply specific column of a matrix by specific element

>> A = [1 2 3; 4 5 6; 7 8 9]; >> A(:,2) = A(:,2)*2 A = 1 4 3 4 10 6 7 16 9 >> And se...

multiply specific column of a matrix by specific element

>> A = [1 2 3; 4 5 6; 7 8 9]; >> A(:,2) = A(:,2)*2 A = 1 4 3 4 10 6 7 16 9 >> And se...

12 days ago | 0

Answered

How can I adapt a summation function (see below) with a for loop to create a "x to the power of n" function without using the "^" operator?

Try function [answer] = raised(x,n) answer = 1; for ii = 1:n answer = answer * x; end end and test >...

How can I adapt a summation function (see below) with a for loop to create a "x to the power of n" function without using the "^" operator?

Try function [answer] = raised(x,n) answer = 1; for ii = 1:n answer = answer * x; end end and test >...

13 days ago | 1

Answered

I know this is an invalid expression on line 9. How can I correct this error? Also, what error is this exactly? Matlab displayed multiple possibilities when trying to correct it.

Replace case (3 5 7) by case {3,5,7} With curly brackets "what error is this" It's break the switch-case-otherwise syn...

I know this is an invalid expression on line 9. How can I correct this error? Also, what error is this exactly? Matlab displayed multiple possibilities when trying to correct it.

Replace case (3 5 7) by case {3,5,7} With curly brackets "what error is this" It's break the switch-case-otherwise syn...

14 days ago | 1

| accepted

Answered

I have a 9x1253 matrix: i found the max values of this matrix, but i need to find what row and column they belong to and show that.

See the subsection Largest Element in Matrix of https://se.mathworks.com/help/matlab/ref/max.html In response to comment...

I have a 9x1253 matrix: i found the max values of this matrix, but i need to find what row and column they belong to and show that.

See the subsection Largest Element in Matrix of https://se.mathworks.com/help/matlab/ref/max.html In response to comment...

14 days ago | 0

Answered

Why is my GUI program producing an error when I 'Run' it

The error message states that the function plotchar isn't found. >> plotchar 'plotchar' requires Character Recognition Exampl...

Why is my GUI program producing an error when I 'Run' it

The error message states that the function plotchar isn't found. >> plotchar 'plotchar' requires Character Recognition Exampl...

15 days ago | 1

| accepted

Answered

My code works as a script file but produces errors as a GUI function, how do I fix it?

One observation sortKey = sort(numKey); ... x = find(numKey ~= sortKey); x2 = x([2,1]); x will be empty if numkey is alread...

My code works as a script file but produces errors as a GUI function, how do I fix it?

One observation sortKey = sort(numKey); ... x = find(numKey ~= sortKey); x2 = x([2,1]); x will be empty if numkey is alread...

16 days ago | 0

| accepted

Answered

preallocate array without initializing

Try this >> A(100,100) = 0; >> whos A Name Size Bytes Class Attributes A 100x100 ...

preallocate array without initializing

Try this >> A(100,100) = 0; >> whos A Name Size Bytes Class Attributes A 100x100 ...

16 days ago | 0

Answered

How to specify the output type of an fread(fid...) ?

Try this little experiment (based on the first example in the doc) %% fid = fopen('nine.bin','w'); fwrite(fid,[1:9]); fclose...

How to specify the output type of an fread(fid...) ?

Try this little experiment (based on the first example in the doc) %% fid = fopen('nine.bin','w'); fwrite(fid,[1:9]); fclose...

16 days ago | 0

| accepted

Answered

MATLAB has encountered an internal problem and needs to close

Shit happens! If this problem is reproducible, please submit a Service Request via: http://www.mathworks.com/support/con...

MATLAB has encountered an internal problem and needs to close

Shit happens! If this problem is reproducible, please submit a Service Request via: http://www.mathworks.com/support/con...

16 days ago | 0