251 total contributions since 2019

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

Answered

Linear regression with formulas

Hi, Here is the solution: function [a, b] = linear_regression(x,y) a = sum((x-mean(x)).*(y-mean(y)))./sum((x-mean(x)).^2)...

Linear regression with formulas

Hi, Here is the solution: function [a, b] = linear_regression(x,y) a = sum((x-mean(x)).*(y-mean(y)))./sum((x-mean(x)).^2)...

ongeveer 7 uur ago | 0

Answered

What is the best way to set up a nested for loop?

Hi Steven, Here is the complete solution of your problem: clearvars %% Part 0. Loading data load('Triplets'); load('F_point...

What is the best way to set up a nested for loop?

Hi Steven, Here is the complete solution of your problem: clearvars %% Part 0. Loading data load('Triplets'); load('F_point...

ongeveer 9 uur ago | 0

Answered

What is the best way to set up a nested for loop?

Hi Steven, You loop is not doing much. SInce you are saving the last value from your nested loops. If this is what you want the...

What is the best way to set up a nested for loop?

Hi Steven, You loop is not doing much. SInce you are saving the last value from your nested loops. If this is what you want the...

1 dag ago | 0

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

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

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

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

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

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

27 dagen 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'; ...

ongeveer een maand 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...

ongeveer een maand 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...

ongeveer een maand 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...

ongeveer een maand 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, ...

ongeveer een maand 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...

ongeveer een maand 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...

ongeveer een maand 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...

ongeveer een maand 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...

ongeveer een maand 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.

ongeveer een maand 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...

ongeveer een maand ago | 0

Solved

Pi Estimate 1

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

ongeveer een maand ago

Solved

Evil Number

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

ongeveer een maand 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...

ongeveer een maand 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. ...

ongeveer een maand 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)

ongeveer een maand ago

Solved

radius of a spherical planet

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

ongeveer een maand 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...

ongeveer een maand ago

Solved

Determine if input is odd

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

ongeveer een maand 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...

ongeveer een maand 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...

ongeveer een maand ago