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

Answered

execute function if any evaluation is found to be false

if strcmp(TrueValMat{2,1}, BOX(1,:))==false... && strcmp(TrueValMat{2,2}, BOX(2,:))==false... ...

execute function if any evaluation is found to be false

if strcmp(TrueValMat{2,1}, BOX(1,:))==false... && strcmp(TrueValMat{2,2}, BOX(2,:))==false... ...

10 days ago | 1

Answered

Values of X where the function is between -0.5 and 0.5

syms x y fplot(legendreP(2:10, x), [-.5, .5]); axis([-0.5 0.5 -.5 .5])

Values of X where the function is between -0.5 and 0.5

syms x y fplot(legendreP(2:10, x), [-.5, .5]); axis([-0.5 0.5 -.5 .5])

10 days ago | 0

Answered

Sine Wave not recognize with find_system

You are right. Its name contains two words and because of that, supposedly it fails to locate it.

Sine Wave not recognize with find_system

You are right. Its name contains two words and because of that, supposedly it fails to locate it.

10 days ago | 1

Answered

Why do the ylabel renderings look different when Property Inspector says they are the same?

It looks like in the first one, "interpreter" option with "latex" has been employed. The second one is indeed is the default fon...

Why do the ylabel renderings look different when Property Inspector says they are the same?

It looks like in the first one, "interpreter" option with "latex" has been employed. The second one is indeed is the default fon...

10 days ago | 0

Answered

Having trouble writing conditional statements?

Hi, Here are the "if" conditions: if azimuths(n)> 90 && azimuths(n)<180 %condition 4 ... end ... if a...

Having trouble writing conditional statements?

Hi, Here are the "if" conditions: if azimuths(n)> 90 && azimuths(n)<180 %condition 4 ... end ... if a...

10 days ago | 1

Answered

i need help with my code, for error

Here are corrected part of your script: Ks=str2double(doubleKs{:}); Re=str2double(Re{:}); D = str2double(D{:}); % Data conv...

i need help with my code, for error

Here are corrected part of your script: Ks=str2double(doubleKs{:}); Re=str2double(Re{:}); D = str2double(D{:}); % Data conv...

10 days ago | 0

Answered

Creating a piecewise sine function having different frequency components

There are two opts. One elementwise multiplication and the other is just product. % (1) Elementwise: S1S2_e = s1.*s2; % (2) J...

Creating a piecewise sine function having different frequency components

There are two opts. One elementwise multiplication and the other is just product. % (1) Elementwise: S1S2_e = s1.*s2; % (2) J...

15 days ago | 0

Answered

Finding the index in two different arrays where values are closest

The answer is a quite straightforward that is to find the minimum of differences between the two lines. E.g.: DR = Rtrue1-Rtrue...

Finding the index in two different arrays where values are closest

The answer is a quite straightforward that is to find the minimum of differences between the two lines. E.g.: DR = Rtrue1-Rtrue...

1 month ago | 0

Answered

Running anonymous function in MATLAB for sub-mesh.

Hi, Here is one of the viable solutuons to your exercise using the function option: clearvars % Number of circles to draw ...

Running anonymous function in MATLAB for sub-mesh.

Hi, Here is one of the viable solutuons to your exercise using the function option: clearvars % Number of circles to draw ...

1 month ago | 0

| accepted

Answered

How to do FFT on accelerometer excel data in Matlab?

Import your data Perfform fft(). Here is a nice documentation how to sue fft().

How to do FFT on accelerometer excel data in Matlab?

Import your data Perfform fft(). Here is a nice documentation how to sue fft().

2 months ago | 0

Answered

Plotting y = kx

k=1:999; x =1:2024; F = k.* x(:); N = 25; contour(k, x, F, N), shg xlabel('k stifness'), ylael(' ...')

Plotting y = kx

k=1:999; x =1:2024; F = k.* x(:); N = 25; contour(k, x, F, N), shg xlabel('k stifness'), ylael(' ...')

2 months ago | 1

Answered

Viewing IMD binary data

You can read (import) binary data into MATLAB using fread() (see doc here) and then you can plot it to visualize, and so forth.

Viewing IMD binary data

You can read (import) binary data into MATLAB using fread() (see doc here) and then you can plot it to visualize, and so forth.

2 months ago | 0

Answered

Why does the array only work once?

Hi, You have overlooked a few dot operations. Here is the corrected part of your code: %Finding angle Phi of force P ...

Why does the array only work once?

Hi, You have overlooked a few dot operations. Here is the corrected part of your code: %Finding angle Phi of force P ...

2 months ago | 1

Answered

Variable indexing for loop when vector is negative (Array indices must be positive integers or logical values)

Hi, Vectorization is the most efficient way, e.g.: a = 12*x.^5; Or if you need to do via a loop, then for ii=1:numel(x) ...

Variable indexing for loop when vector is negative (Array indices must be positive integers or logical values)

Hi, Vectorization is the most efficient way, e.g.: a = 12*x.^5; Or if you need to do via a loop, then for ii=1:numel(x) ...

2 months ago | 0

Answered

How to check if a column data is equal to any of a group of values?

Altenrative (more efficient one) solution can be this one: S = sum(sum(ismember(A,B)))

How to check if a column data is equal to any of a group of values?

Altenrative (more efficient one) solution can be this one: S = sum(sum(ismember(A,B)))

2 months ago | 0

Answered

How to check if a column data is equal to any of a group of values?

You can use a loop for instance if you have many Bs, e.g.: for ii = 1:numel(B) Ind = A==B(ii); S(ii) = sum(Ind(:)); ...

How to check if a column data is equal to any of a group of values?

You can use a loop for instance if you have many Bs, e.g.: for ii = 1:numel(B) Ind = A==B(ii); S(ii) = sum(Ind(:)); ...

2 months ago | 0

Answered

Taylor Series for e^x with while loop

x = 1.5; SUM = 0; ANS = exp(x); Err = ANS-SUM; Err_Margin = 1e-9; ii=0; while Err > Err_margin ii=ii+1; ...

Taylor Series for e^x with while loop

x = 1.5; SUM = 0; ANS = exp(x); Err = ANS-SUM; Err_Margin = 1e-9; ii=0; while Err > Err_margin ii=ii+1; ...

2 months ago | 0

Answered

electromechanical relays and real time simulation

With your exercise, it is quite easy to employ Simulink/Simscape toolbox. See simulink dashboard tutorial: https://www.mathworks...

electromechanical relays and real time simulation

With your exercise, it is quite easy to employ Simulink/Simscape toolbox. See simulink dashboard tutorial: https://www.mathworks...

2 months ago | 0

Answered

I have a function to find the standard deviation of a matrix of scores, I now need to use that same standard deviation equation using the mean of said scores and get a scalar in return.

To get mean and median values of the whole class (e.g. Score of size 25-by-10) in one subject (e.g.: assignment # 1) should be c...

I have a function to find the standard deviation of a matrix of scores, I now need to use that same standard deviation equation using the mean of said scores and get a scalar in return.

To get mean and median values of the whole class (e.g. Score of size 25-by-10) in one subject (e.g.: assignment # 1) should be c...

2 months ago | 0

| accepted

Answered

Excite Single Input of a MIMO System

Use switch block either manual or combinatorial switch block: https://www.mathworks.com/help/simulink/slref/manualswitch.html...

Excite Single Input of a MIMO System

Use switch block either manual or combinatorial switch block: https://www.mathworks.com/help/simulink/slref/manualswitch.html...

2 months ago | 0

Answered

Save Figure as JPEG or PNG from Vector Scope

Use: saveas() See: https://www.mathworks.com/help/matlab/ref/saveas.html

Save Figure as JPEG or PNG from Vector Scope

Use: saveas() See: https://www.mathworks.com/help/matlab/ref/saveas.html

2 months ago | 0

Answered

How to check if a column data is equal to any of a group of values?

Hi, Ind = sum(Ind1) + (Ind2);

How to check if a column data is equal to any of a group of values?

Hi, Ind = sum(Ind1) + (Ind2);

2 months ago | 0

Solved

Split a string into chunks of specified length

Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

2 months ago

Solved

Natural numbers in string form

Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

2 months ago

Solved

Fix the last element of a cell array

Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

2 months ago

Solved

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values

<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

2 months ago

Solved

Cell Counting: How Many Draws?

You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

2 months ago

Solved

Remove element(s) from cell array

You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

2 months ago

Solved

Convert a Cell Array into an Array

Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

2 months ago