323 total contributions since 2019

research interests: vibrations, optimal control, system modeling and simulation, mechatronics... coding

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...

2 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'...

2 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); ...

2 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 ...

2 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...

2 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...

2 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...

2 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'); ...

3 days 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(...

3 days 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...

3 days 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...

3 days 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 ...

3 days ago | 0

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...

3 days 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 ...

4 days ago | 0

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 ...

4 days 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...

4 days 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

4 days 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...

4 days 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...

4 days 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.

5 days 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...

5 days 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

5 days 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...

9 days 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...

9 days 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 ...

9 days 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.

9 days 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 ...

10 days 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 ...

10 days 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...

10 days 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...

10 days ago