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

Answered

ASSISTANCE ON RUNNING RANDOM VARIABLES IN A FUNCTION

Hi, Here is a nice tutorial that explains everything what you need for your exercise. https://www.mathworks.com/help/matlab/...

ASSISTANCE ON RUNNING RANDOM VARIABLES IN A FUNCTION

Hi, Here is a nice tutorial that explains everything what you need for your exercise. https://www.mathworks.com/help/matlab/...

7 hours ago | 0

Answered

How do I hanning window a signal before FFT, inside of for loop?

Hi, You can insert your anticipated hanning window command on line 81 of your script, i.e., hold on; WIN_Hann=hann(length(Di...

How do I hanning window a signal before FFT, inside of for loop?

Hi, You can insert your anticipated hanning window command on line 81 of your script, i.e., hold on; WIN_Hann=hann(length(Di...

7 hours ago | 0

Answered

how to compute the complex Fourier series expansion of half-wave rectified signal. and plot its phase and amplitude spectrum?

Hi, Here are several nice tutorial examples of matlab on Fourier Transform. https://www.mathworks.com/help/matlab/math/fouri...

how to compute the complex Fourier series expansion of half-wave rectified signal. and plot its phase and amplitude spectrum?

Hi, Here are several nice tutorial examples of matlab on Fourier Transform. https://www.mathworks.com/help/matlab/math/fouri...

8 hours ago | 1

Answered

Gerchberg–Saxton algorithm/ Phase Retreiveal algorithm

Here is one of the nice scripts posted on the MathWorks website: https://www.mathworks.com/matlabcentral/fileexchange/65979-gerc...

Gerchberg–Saxton algorithm/ Phase Retreiveal algorithm

Here is one of the nice scripts posted on the MathWorks website: https://www.mathworks.com/matlabcentral/fileexchange/65979-gerc...

2 days ago | 0

Answered

How to apply a random Crossover (Arithmetic/Scattered/Two-point) in Genetic Algorithm using auto-generated file from Optimization Toolbox ?

See the screen shot given in the attachement. You should select from the drop-down options whichever crossover function suits fo...

How to apply a random Crossover (Arithmetic/Scattered/Two-point) in Genetic Algorithm using auto-generated file from Optimization Toolbox ?

See the screen shot given in the attachement. You should select from the drop-down options whichever crossover function suits fo...

2 days ago | 0

Answered

Improving fit of custom function

Hi, Why not to use cftool (Curve Fitting Toolbox). Launch it with: >> cftool Indicate your x data and y data variable na...

Improving fit of custom function

Hi, Why not to use cftool (Curve Fitting Toolbox). Launch it with: >> cftool Indicate your x data and y data variable na...

3 days ago | 0

Answered

C = union( A,B ) is too slow. Is there any faster way given that A and B are ordered.

Hi, This one could be faster: ismember(A, B)

C = union( A,B ) is too slow. Is there any faster way given that A and B are ordered.

Hi, This one could be faster: ismember(A, B)

3 days ago | 0

Answered

how to transfer a 3D variable into a row in an excel file?

Hi, a simple solution might be this one: for ii=1:14 % EEGData has 14 layers SH=strcat('Sheet', num2str(ii)); xls...

how to transfer a 3D variable into a row in an excel file?

Hi, a simple solution might be this one: for ii=1:14 % EEGData has 14 layers SH=strcat('Sheet', num2str(ii)); xls...

3 days ago | 0

Answered

what is wrong here? ??? Error using ==> times Matrix dimensions must agree.

Hi, There is two small but crucial errs - see the command below: %... Fi=fftshift(double(A)); % NOTE your assigned var...

what is wrong here? ??? Error using ==> times Matrix dimensions must agree.

Hi, There is two small but crucial errs - see the command below: %... Fi=fftshift(double(A)); % NOTE your assigned var...

3 days ago | 0

Answered

How can I index one array using element values from another array

Hi, Again using logical indexing might be one of the easy ways of doing it: Y_sub30 = y(z < 30); Total_sub30=sum(Y_sub30); ...

How can I index one array using element values from another array

Hi, Again using logical indexing might be one of the easy ways of doing it: Y_sub30 = y(z < 30); Total_sub30=sum(Y_sub30); ...

3 days ago | 1

| accepted

Answered

phase plot fft (strange)values

Hi, There was a small but crucial mistake while defining 's' signal. Here is the corrected one: s = cos(2*pi*15*t -30*pi/180...

phase plot fft (strange)values

Hi, There was a small but crucial mistake while defining 's' signal. Here is the corrected one: s = cos(2*pi*15*t -30*pi/180...

3 days ago | 0

| accepted

Answered

Convert .mat file into .csv file

Hi, For your data, converting into xls or xlsx would be easier. If you'd need only csv, then you'd need to use the syntax as th...

Convert .mat file into .csv file

Hi, For your data, converting into xls or xlsx would be easier. If you'd need only csv, then you'd need to use the syntax as th...

4 days ago | 1

| accepted

Answered

Kindly help me to obtain the first four numerical solution of given trancedental equation "luck 1"

Use the commands: EQN = luck1==0 SOL = solve(EQN, x); SOL = double(SOL);

Kindly help me to obtain the first four numerical solution of given trancedental equation "luck 1"

Use the commands: EQN = luck1==0 SOL = solve(EQN, x); SOL = double(SOL);

4 days ago | 0

Answered

How to use linear regression modeling for x-vector of dimension m and y-vector of dimension m

Hi, If your given data for x and y are 1-by-1000 or 1-by-10000000 ... . Briefly speaking your data is 1D. Then you'd need to us...

How to use linear regression modeling for x-vector of dimension m and y-vector of dimension m

Hi, If your given data for x and y are 1-by-1000 or 1-by-10000000 ... . Briefly speaking your data is 1D. Then you'd need to us...

4 days ago | 0

Answered

Can display block show more than a 10x20 matrix?

Hi, There is an easy solution for your exercise that is to use "To Workspace" block instead of "Display" block. Then you will...

Can display block show more than a 10x20 matrix?

Hi, There is an easy solution for your exercise that is to use "To Workspace" block instead of "Display" block. Then you will...

4 days ago | 0

Answered

how to zoom-out on a figure window in a script

Hi, Here are two simple ways of solving your task: 1) using zoom() function, e.g.: figure, plot(rand(10,1),'bo-') zoom(0.75)...

how to zoom-out on a figure window in a script

Hi, Here are two simple ways of solving your task: 1) using zoom() function, e.g.: figure, plot(rand(10,1),'bo-') zoom(0.75)...

4 days ago | 0

Answered

Replace values in grid data (3D) to NaN, like another (3D) have NaN

It can be done very easily with a logical indexing opt: e.g.: Index = isnan(SST); VWind(Index)=NaN; Now you can compare and...

Replace values in grid data (3D) to NaN, like another (3D) have NaN

It can be done very easily with a logical indexing opt: e.g.: Index = isnan(SST); VWind(Index)=NaN; Now you can compare and...

7 days ago | 0

| accepted

Answered

Transfer Function with one 1/s term

Hi, It is straightforward: T = tf([1 0 1], [1 1 1 0]); nyquist(T)

Transfer Function with one 1/s term

Hi, It is straightforward: T = tf([1 0 1], [1 1 1 0]); nyquist(T)

7 days ago | 0

| accepted

Answered

Tensor Product According to Input (Dynamically)

If your variable sigma_x is 90 rotated eye matrix, then you can use A = rot90(eye(d)); Good luck

Tensor Product According to Input (Dynamically)

If your variable sigma_x is 90 rotated eye matrix, then you can use A = rot90(eye(d)); Good luck

1 month ago | 0

Answered

How to rename a bunch of files in a folder

Here is the answer that changes the file names to: 1a.tif, 2a.tif, 3a.tif, ..., etc. files = dir('*.tif'); for ii = 1:length(f...

How to rename a bunch of files in a folder

Here is the answer that changes the file names to: 1a.tif, 2a.tif, 3a.tif, ..., etc. files = dir('*.tif'); for ii = 1:length(f...

2 months ago | 0

Answered

How to generate a real time signal?

If what you need is a sort of white noise, then you can use random number generators, e.g.: rand() - uniform distributed, ran...

How to generate a real time signal?

If what you need is a sort of white noise, then you can use random number generators, e.g.: rand() - uniform distributed, ran...

2 months ago | 0

Answered

" Array dimensions must match for binary array op."

Here is one of the easy solutions: for jj=1:numel(ThAll) TH_all=ThAll{jj}; for kk=1:4 TH_ALL(jj, k...

" Array dimensions must match for binary array op."

Here is one of the easy solutions: for jj=1:numel(ThAll) TH_all=ThAll{jj}; for kk=1:4 TH_ALL(jj, k...

2 months ago | 0

Answered

Can someone advise how I fix this loop?

Hi, That would be somewhat in this way: for ii = 1:59 sFiles(ii).iStudy = bst_process('CallProcess', 'process_select_search...

Can someone advise how I fix this loop?

Hi, That would be somewhat in this way: for ii = 1:59 sFiles(ii).iStudy = bst_process('CallProcess', 'process_select_search...

2 months ago | 0

| accepted

Answered

Create plot handle without rendering it.

H = figure("Visible",false); HH = plot(1:5);

Create plot handle without rendering it.

H = figure("Visible",false); HH = plot(1:5);

2 months ago | 0

| accepted

Answered

saving variables programmatically using list of variable names

Here is an easy solution: a=1;b=2;c=3; save('myMatFile.mat','a','b','c') % Or a=1;b=2;c=3; MY_var = {'a','b','c'}; save(...

saving variables programmatically using list of variable names

Here is an easy solution: a=1;b=2;c=3; save('myMatFile.mat','a','b','c') % Or a=1;b=2;c=3; MY_var = {'a','b','c'}; save(...

2 months ago | 0

Answered

How to fix: Index Exceeds Matrix Dimensions

Put your file to be read in your current directory.

How to fix: Index Exceeds Matrix Dimensions

Put your file to be read in your current directory.

2 months ago | 0

| accepted

Answered

Return Indices for x Smallest/Largest Values in Array

here is one of the possible ways: A = [...; ...; ...]; [Row1,Col1]=find(max(A(:))==A) % Shows row# and col# of largest element...

Return Indices for x Smallest/Largest Values in Array

here is one of the possible ways: A = [...; ...; ...]; [Row1,Col1]=find(max(A(:))==A) % Shows row# and col# of largest element...

2 months ago | 1

Answered

How to fix: Index Exceeds Matrix Dimensions

Remove: (1) in filenames(1).name on line on line 88

How to fix: Index Exceeds Matrix Dimensions

Remove: (1) in filenames(1).name on line on line 88

2 months ago | 0

Answered

Why White Noise is not adding Uniformly to Signal?

In your plot section, you are plotting three sets instead of four and thus, the noise added signal is not showing up. See: ...

Why White Noise is not adding Uniformly to Signal?

In your plot section, you are plotting three sets instead of four and thus, the noise added signal is not showing up. See: ...

2 months ago | 0

Answered

How ı can write this function on Matlab

Hi, Here is one of the possible solutions for x having a single value: function Y = MY_fun(x) if x>=1 && x<10 Y = ex...

How ı can write this function on Matlab

Hi, Here is one of the possible solutions for x having a single value: function Y = MY_fun(x) if x>=1 && x<10 Y = ex...

2 months ago | 0

| accepted