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

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

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

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

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

7 years 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'; ...

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

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

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

7 years 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, ...

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

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

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

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

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

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

7 years ago | 0

Solved


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

7 years ago

Solved


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

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

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

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

7 years ago

Solved


radius of a spherical planet
You just measured its surface area, that is the input.

7 years ago

Solved


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

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

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

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

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

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

7 years ago

Solved


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

7 years ago

Solved


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

7 years ago

Load more