248 total contributions since 2019

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

Answered

How to plot a function over a time interval in specific time increments?

Hi, Here is the plain answer: xt = @(t) sin(pi*t); dt = pi/100; t = 0:dt:20; plot(t, xt(t))

How to plot a function over a time interval in specific time increments?

Hi, Here is the plain answer: xt = @(t) sin(pi*t); dt = pi/100; t = 0:dt:20; plot(t, xt(t))

2 days ago | 0

Answered

How can i find indexes of multiple strings from a cell array?

hi, Here is one plain answer; % Search string: STR = 'hhh'; % Index finding: IndexFind = strfind(A, STR); Index = find(n...

How can i find indexes of multiple strings from a cell array?

hi, Here is one plain answer; % Search string: STR = 'hhh'; % Index finding: IndexFind = strfind(A, STR); Index = find(n...

2 days ago | 0

| accepted

Solved

Find the 9's Complement

Find the 9's complement of the given number. An example of how this works is <http://electrical4u.com/9s-complement-and-10s-c...

17 days ago

Answered

Index in position 1 exceeds array bounds (must not exceed 1).

Hi, In your command to display the string: '0 cell in core' One of your set logical indexes ( total_cellcount.time(find(isin...

Index in position 1 exceeds array bounds (must not exceed 1).

Hi, In your command to display the string: '0 cell in core' One of your set logical indexes ( total_cellcount.time(find(isin...

19 days ago | 0

Answered

How can be generated aperiodic triangle carrier signal for PWM

Hi Ali, for your problem, sawtooth() function does not work. Instead you'd need to employ triangular pulse generator function...

How can be generated aperiodic triangle carrier signal for PWM

Hi Ali, for your problem, sawtooth() function does not work. Instead you'd need to employ triangular pulse generator function...

25 days ago | 1

Answered

How to deal with NaN in 'from spreadsheet' block in Simulink? How do I make Simulink ignore NaNs?

Hi, I would suggest to try two different ways: Substitute all NaNs with "0"s or something else with relational operator bef...

How to deal with NaN in 'from spreadsheet' block in Simulink? How do I make Simulink ignore NaNs?

Hi, I would suggest to try two different ways: Substitute all NaNs with "0"s or something else with relational operator bef...

25 days ago | 0

Answered

Time reading in matlab

Hi, Here is the complete solution script. Please note that your data file is renamed (S1932.txt): File_Name = 'S1932.txt'; ...

Time reading in matlab

Hi, Here is the complete solution script. Please note that your data file is renamed (S1932.txt): File_Name = 'S1932.txt'; ...

29 days ago | 0

| accepted

Answered

How to filter multiples non harmonic frequencies?

Hi, Without simulating your code, I'd suggest to try savitsky-golay filter: sgolayfilt() as a choice (1), as a choice (2) - b...

How to filter multiples non harmonic frequencies?

Hi, Without simulating your code, I'd suggest to try savitsky-golay filter: sgolayfilt() as a choice (1), as a choice (2) - b...

1 month ago | 0

Answered

how take input and save to an array in matlab gui

Hi Muhammad, In your exercise, you'd need to edit your function file (nested callback function for [Push Button]) obtained fr...

how take input and save to an array in matlab gui

Hi Muhammad, In your exercise, you'd need to edit your function file (nested callback function for [Push Button]) obtained fr...

1 month ago | 0

| accepted

Solved

Remove the air bubbles

Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

1 month ago

Solved

Elapsed Time

Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

1 month ago

Answered

how to solve first order nonlinear ode45 in a loop?

Your code has some flaws: (1) theta(npeop,1) = Phi_i; is to be: theta(1:npeop,1) = Phi_i; (2) Moreover, there are several u...

how to solve first order nonlinear ode45 in a loop?

Your code has some flaws: (1) theta(npeop,1) = Phi_i; is to be: theta(1:npeop,1) = Phi_i; (2) Moreover, there are several u...

1 month ago | 0

Answered

StateFlow Negative in Condition Issue

One of the possible problems might be a built-in function assert(). Once I have had such problem and removed the wrong-placed as...

StateFlow Negative in Condition Issue

One of the possible problems might be a built-in function assert(). Once I have had such problem and removed the wrong-placed as...

1 month ago | 0

Answered

Preventing Emphasis in plot from Simulink Model

Maybe just save/store the data instead of plotting them while simulating the model and plot afterwards if there is no need to vi...

Preventing Emphasis in plot from Simulink Model

Maybe just save/store the data instead of plotting them while simulating the model and plot afterwards if there is no need to vi...

1 month ago | 0

Answered

How do I preallocate my variables for speed when creating an SIR model?

Memory allocation does not correct your code's errors. It helps to speed up the process of calculation and simulation. Your udp...

How do I preallocate my variables for speed when creating an SIR model?

Memory allocation does not correct your code's errors. It helps to speed up the process of calculation and simulation. Your udp...

1 month ago | 0

Answered

Changing default output in Publish (vsn 17b)

You can change [Edit Configurations] options... to publish in pdf as a default instead of html.

Changing default output in Publish (vsn 17b)

You can change [Edit Configurations] options... to publish in pdf as a default instead of html.

1 month ago | 0

Answered

How to get the values of for loop subsystem after every iteration in simulink

Have you tried these: https://www.mathworks.com/help/simulink/slref/selector.html https://www.mathworks.com/help/simulink/slre...

How to get the values of for loop subsystem after every iteration in simulink

Have you tried these: https://www.mathworks.com/help/simulink/slref/selector.html https://www.mathworks.com/help/simulink/slre...

1 month ago | 0

Solved

Pi Estimate 1

Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

1 month ago

Solved

Evil Number

Check if a given natural number is evil or not. Read more at <https://oeis.org/A001969 OEIS>.

1 month ago

Solved

Return the 3n+1 sequence for n

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

1 month ago

Solved

random picture with random colours

write a function which creates a random(x,y) matrix with random RGB colours for example create_pic(5,5) gives us a 3d matrix. ...

1 month ago

Solved

Solve the set of simultaneous linear equations

Given this pair of simultaneous linear equations: 2x + 3y = 23 3x + 4y = 32 Find the solution set (x,y)

1 month ago

Solved

radius of a spherical planet

You just measured its surface area, that is the input.

1 month ago

Solved

Pizza!

Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

1 month ago

Solved

Determine if input is odd

Given the input n, return true if n is odd or false if n is even.

1 month ago

Solved

Operate on matrices of unequal, yet similar, size

You may want to add a vector to a matrix, implying that the vector is added to each column of the matrix. Or multiply a 3x4x5 ma...

1 month ago

Solved

Reverse the elements of an array

Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

1 month ago

Solved

Rotate input square matrix 90 degrees CCW without rot90

Rotate input matrix (which will be square) 90 degrees counter-clockwise without using rot90,flipud,fliplr, or flipdim (or eval)....

1 month ago

Solved

Matrix with different incremental runs

Given a vector of positive integers a = [ 3 2 4 ]; create the matrix where the *i* th column contains the vector *1:a(i)...

1 month ago

Solved

surrounded matrix

With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

1 month ago