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

Answered

I want to store data in a matrix from a for loop using non integer indexing

Hi, There are several ways of doing it: Most efficient way: x = [5:0.1:20]; v = (1:.1:10)'; MAT=v.*x; 2. Least efficie...

I want to store data in a matrix from a for loop using non integer indexing

Hi, There are several ways of doing it: Most efficient way: x = [5:0.1:20]; v = (1:.1:10)'; MAT=v.*x; 2. Least efficie...

3 hours ago | 0

Answered

Make a point move straight up and down

Hi, If I've understood your question correctly, you'd like to get a up and down motion of a point x, y(i). Then here is one o...

Make a point move straight up and down

Hi, If I've understood your question correctly, you'd like to get a up and down motion of a point x, y(i). Then here is one o...

3 hours ago | 0

Answered

Make a point move straight up and down

Hi, A simple motion or animation tool with plot tools is drawnow that can be employed in your task, e.g.: https://www.math...

Make a point move straight up and down

Hi, A simple motion or animation tool with plot tools is drawnow that can be employed in your task, e.g.: https://www.math...

4 hours ago | 0

Answered

How to create a movie from different .fig files ?

Hi, One of the easy matlab fcns to build movies from plot figures is getframe() along with drawnow. See the help doc: https:...

How to create a movie from different .fig files ?

Hi, One of the easy matlab fcns to build movies from plot figures is getframe() along with drawnow. See the help doc: https:...

4 hours ago | 0

Answered

How can one put mean and std of the data into histogram using annotation?

Hi, A user can fully control the location of the legend by indicating its location as: legend({sprintf('mean = %3.2f, std = ...

How can one put mean and std of the data into histogram using annotation?

Hi, A user can fully control the location of the legend by indicating its location as: legend({sprintf('mean = %3.2f, std = ...

4 hours ago | 0

Answered

create a vector of 0 and 1s that takes 1 at a fixed interval

Hi, O=zeros(1, 20); m=input('m = '); IN=m+1:m+1:numel(O); O(IN)=1;

create a vector of 0 and 1s that takes 1 at a fixed interval

Hi, O=zeros(1, 20); m=input('m = '); IN=m+1:m+1:numel(O); O(IN)=1;

17 hours ago | 0

Answered

problems using Start in Data Acquisition script

Hi Maybe you should add data rate, e.g.: D = daq("ni"); D.Rate = 5000; addinput(D, "ThunderdomeDAQ", "ai0", "Voltage"); ...

problems using Start in Data Acquisition script

Hi Maybe you should add data rate, e.g.: D = daq("ni"); D.Rate = 5000; addinput(D, "ThunderdomeDAQ", "ai0", "Voltage"); ...

17 hours ago | 0

Answered

Simulink,Increase the simulation speed

Hi You can try: a variable step solver: adjust absolute and realtive tolerances a fixed step solver: use a few different...

Simulink,Increase the simulation speed

Hi You can try: a variable step solver: adjust absolute and realtive tolerances a fixed step solver: use a few different...

18 hours ago | 0

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

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

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

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

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

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

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

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

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

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

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

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

6 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);

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

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

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

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

9 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)

9 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