Answered

Using same figure properties (e.g. current axes) onto new ones

hi, An easy way is to create/generate (MATLAB automatically) a plot building file from your already created plot figure via F...

Using same figure properties (e.g. current axes) onto new ones

hi, An easy way is to create/generate (MATLAB automatically) a plot building file from your already created plot figure via F...

30 days ago | 1

| accepted

Answered

timerange in a loop

How about this way: for ii=2012:2016 H{ii-2011,1} = [num2str(ii), '-01-01']; H{ii-2011, 2}= [num2str(ii), '-02-01'...

timerange in a loop

How about this way: for ii=2012:2016 H{ii-2011,1} = [num2str(ii), '-01-01']; H{ii-2011, 2}= [num2str(ii), '-02-01'...

30 days ago | 1

Answered

How can i create MxN matrix?

Hi, you are going to create a linear system of equations (augmented matrix) 5001 - by - 1001, then A_M = ones(5001, 1001); ...

How can i create MxN matrix?

Hi, you are going to create a linear system of equations (augmented matrix) 5001 - by - 1001, then A_M = ones(5001, 1001); ...

30 days ago | 0

Answered

timerange in a loop

Hi, What about this: for ii=2012:2016 H{ii-2011} = [num2str(ii), '-01-01',' : ', num2str(ii), '-02-01']; end Good ...

timerange in a loop

Hi, What about this: for ii=2012:2016 H{ii-2011} = [num2str(ii), '-01-01',' : ', num2str(ii), '-02-01']; end Good ...

30 days ago | 1

Answered

Variables keep overwriting when i change the name

Hi, You would need to create a small loop to run your simulink model via sim() command and every iteration results can be sav...

Variables keep overwriting when i change the name

Hi, You would need to create a small loop to run your simulink model via sim() command and every iteration results can be sav...

30 days ago | 0

Answered

error in running code

It is working. It has been tested in MATLAB 2019b (it is an M-file and not a function file in this test). It also runs well if s...

error in running code

It is working. It has been tested in MATLAB 2019b (it is an M-file and not a function file in this test). It also runs well if s...

30 days ago | 0

Answered

Plot 2D graph - parameters explanation?

Hi, if I have understood your question correctly, the answer lies in ylim: ylim([-1.5 1.5]) And this plot is not obtained w...

Plot 2D graph - parameters explanation?

Hi, if I have understood your question correctly, the answer lies in ylim: ylim([-1.5 1.5]) And this plot is not obtained w...

30 days ago | 0

Answered

Designing a Notch Filter

% The signal processing toolbox of MATLAB has: iirnotch() % Import your wav file with: [y,Fs] = audioread('AUDIO_FIle.wav'); ...

Designing a Notch Filter

% The signal processing toolbox of MATLAB has: iirnotch() % Import your wav file with: [y,Fs] = audioread('AUDIO_FIle.wav'); ...

1 month ago | 0

Answered

combinations and their sum

Hi, Here is a rather simple answer: [A1,A2,A3,A4] = ndgrid([1 2 1 2]); VERS = [A1(:), A2(:), A3(:), A4(:)] SUM_VERS = sum(...

combinations and their sum

Hi, Here is a rather simple answer: [A1,A2,A3,A4] = ndgrid([1 2 1 2]); VERS = [A1(:), A2(:), A3(:), A4(:)] SUM_VERS = sum(...

1 month ago | 0

Answered

Need a help in this code

Hi, problem is in your loop set up: for i = n:1 % <---- ERROR fullRecon = idwt2(LL{i},LH{i},HL{i},fullRecon,'Haar'); en...

Need a help in this code

Hi, problem is in your loop set up: for i = n:1 % <---- ERROR fullRecon = idwt2(LL{i},LH{i},HL{i},fullRecon,'Haar'); en...

1 month ago | 0

| accepted

Answered

Error using imread>get_full_filename (line 566) File "PAT\NPatsmall\0.tif" does not exist.

Hi Abdallah, All of your folders from which you are trying to get data/images are added to the search path of your matlab. If...

Error using imread>get_full_filename (line 566) File "PAT\NPatsmall\0.tif" does not exist.

Hi Abdallah, All of your folders from which you are trying to get data/images are added to the search path of your matlab. If...

1 month ago | 0

| accepted

Answered

How to save score from game and then load it when second attempt is made

Hi, Now it is running as anticipated. When you start with the following intialization (score is <6), e.g.: >> score=1; save ...

How to save score from game and then load it when second attempt is made

Hi, Now it is running as anticipated. When you start with the following intialization (score is <6), e.g.: >> score=1; save ...

1 month ago | 0

| accepted

Answered

Bar plot axes size using text in X axis

Hi Here is the solution for x axis: xticks(1:numel(neworder(:,1))) F = neworder(:,1);set(gca,'FontSize',4); xtickangle(9...

Bar plot axes size using text in X axis

Hi Here is the solution for x axis: xticks(1:numel(neworder(:,1))) F = neworder(:,1);set(gca,'FontSize',4); xtickangle(9...

1 month ago | 0

| accepted

Answered

Regarding language change in R2019b

Suppose that if you change the location, that should change. Since mathworks.com automatically detects the location and selects ...

Regarding language change in R2019b

Suppose that if you change the location, that should change. Since mathworks.com automatically detects the location and selects ...

1 month ago | 1

Answered

Find the number of outputs of a value.

Hi, Here is your code improved a bit and bugs removed: function [A, B, hypotenuse] = M(C) %This calculates the pythagorean ...

Find the number of outputs of a value.

Hi, Here is your code improved a bit and bugs removed: function [A, B, hypotenuse] = M(C) %This calculates the pythagorean ...

1 month ago | 0

Answered

Using a loop and counter for parametric equations

Hi Here is the solution of your task: function E = realED(H, T, h) % % % rho=1030; g=9.81; % % L = zeros(numel(H), n...

Using a loop and counter for parametric equations

Hi Here is the solution of your task: function E = realED(H, T, h) % % % rho=1030; g=9.81; % % L = zeros(numel(H), n...

1 month ago | 0

| accepted

Answered

I have: Error using bsxfun Non-singleton dimensions of the two input arrays must match each other.

Ok

I have: Error using bsxfun Non-singleton dimensions of the two input arrays must match each other.

Ok

1 month ago | 0

Answered

system equation solve error

Hi, Your code's problem is that you are using this code inside your function file. Here is the corrected code: function Solu...

system equation solve error

Hi, Your code's problem is that you are using this code inside your function file. Here is the corrected code: function Solu...

1 month ago | 0

Answered

I have: Error using bsxfun Non-singleton dimensions of the two input arrays must match each other.

Hi, Here is the corrected ver. of your code: function A=test_anode(t,D,c_0,Gamma,I_app) %Compute the mu_n N=20; mu_n=zero...

I have: Error using bsxfun Non-singleton dimensions of the two input arrays must match each other.

Hi, Here is the corrected ver. of your code: function A=test_anode(t,D,c_0,Gamma,I_app) %Compute the mu_n N=20; mu_n=zero...

1 month ago | 0

Answered

Math with Arrays help

Hi, Use colon operator : for A Use exp() for B Good luck.

Math with Arrays help

Hi, Use colon operator : for A Use exp() for B Good luck.

1 month ago | 0

Answered

read an image in matlab2014a

Hi, This is the command: A = imread('IMAGE.jpg'); % Read the image in MATLAB imshow(A) % Display the imported image G...

read an image in matlab2014a

Hi, This is the command: A = imread('IMAGE.jpg'); % Read the image in MATLAB imshow(A) % Display the imported image G...

1 month ago | 0

| accepted

Answered

conversion of image to the form of ones and zeros.

Hi, These two commands will do most of the work: A = imread('MY_image.jpg'); B = im2bw(A); Good luck

conversion of image to the form of ones and zeros.

Hi, These two commands will do most of the work: A = imread('MY_image.jpg'); B = im2bw(A); Good luck

1 month ago | 0

Answered

Finding Complex root for the nonlinear equation with single variable

Hi Ammar, Since your exercise is a nonlinear equation and thus, it is more appropriate to employ Newton-Raphson method for th...

Finding Complex root for the nonlinear equation with single variable

Hi Ammar, Since your exercise is a nonlinear equation and thus, it is more appropriate to employ Newton-Raphson method for th...

1 month ago | 0

Answered

Plotting Sum of series

Hi, In your exercise, it is more appropriate to use numerical solution approach instead of symbolic math. Here is one of th...

Plotting Sum of series

Hi, In your exercise, it is more appropriate to use numerical solution approach instead of symbolic math. Here is one of th...

1 month ago | 1

| accepted

Answered

Legend function does not work in R2019b

Hi, Your code is running ok in Win 10 and MATLAB 2019b. You should close all figure windows, run clear all command or/and if ...

Legend function does not work in R2019b

Hi, Your code is running ok in Win 10 and MATLAB 2019b. You should close all figure windows, run clear all command or/and if ...

1 month ago | 0

Answered

Export data based on latitude and longitude from 3 dimension array

Hi Bekzad, here is the answer: load time TT =datetime(t, 'convertfrom', 'excel'); Now TT are dates. Good luck.

Export data based on latitude and longitude from 3 dimension array

Hi Bekzad, here is the answer: load time TT =datetime(t, 'convertfrom', 'excel'); Now TT are dates. Good luck.

1 month ago | 0

| accepted

Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

1 month ago

Solved

Make an awesome ramp for a tiny motorcycle stuntman

Okay, given a vector, say v=[1 3 6 9 11], turn it into a matrix 'ramp' like so: m=[1 3 6 9 11; 3 6 9 11 0; 6 9 ...

1 month ago

Solved

03 - Matrix Variables 1

Make the following variable: <<http://samle.dk/STTBDP/Assignment1_3a.png>> A 9x9 matrix full of 2's (Hint: use *ones* o...

1 month ago

Solved

Remove any row in which a NaN appears

Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

1 month ago