Solved


Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

6 years ago

Solved


Joining Ranges
You are given a n-by-2 matrix. Each row represents a numeric range, e.g. x = [0 5; 10 3; 20 15; 16 19; 25 25] contains...

6 years ago

Solved


Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

6 years ago

Solved


Create logical matrix with a specific row and column sums
Given two numbers *|n|* and *|s|*, build an |n-by-n| logical matrix (of only zeros and ones), such that both the row sums and th...

6 years ago

Solved


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

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

6 years ago

Solved


Some Assembly Required
The input to this function is a matrix of real numbers. Your job is to assemble the rows of the matrix into one large row that ...

6 years ago

Answered
Plotting a signal between 8 and 15 sec
What is the problem exactly? You have your signal u 3001x1, with a sampling time of 10ms. It means that u(1) is the value of...

6 years ago | 0

Answered
Binary to decimal - 8 bits at a time
You can try something like this using _bin2dec_ : for i=1:8:numel(binary) decimal=bin2dec(num2str(binary(i:i+7))) ...

6 years ago | 2

| accepted

Answered
Compare two folders and write the matching files to the third folder
Have a look at the functions _dir_ and _exist_.

6 years ago | 0

Answered
I have this error, and I don't know how to solve it.Can someone help me please?
The problem is that _Tx_signal_ is not a vector but a matrix of size 1000 x 1000. From the help of _conv_ function: _C = c...

6 years ago | 0

| accepted

Answered
How to design LQR problem for tracking a reference output
You can use the <https://mathworks.com/help/control/ref/lqi.html lqi> function.

6 years ago | 1

Solved


Pascal's Matrix
Given an integer n &ge; 0, generate the ( _n_+1) &times; ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...

6 years ago

Answered
Retrieve data from uitable when user enters data
You should handle the deletion of the table properly as explained here: <https://mathworks.com/matlabcentral/answers/95210-ho...

6 years ago | 1

| accepted

Answered
How to create sine wave from given square wave
You just have to find the frequency of your square wave, and then create a sin wave like in those examples: <https://fr.mathw...

6 years ago | 0

| accepted

Answered
rounding a column vector
Try this: temp=[273.9 274.1 274.5]; round(temp*2)/2 ans = 274.0000 274.0000 274.5000

6 years ago | 0

Answered
Decoding/reading this file
You can use textscan to load the text file.

6 years ago | 0

Answered
How could I translate this Python code to Matlab?
If you want to use your Python code into matlab, you can use: <https://mathworks.com/help/matlab/call-python-libraries.html> ...

6 years ago | 0

| accepted

Answered
vector equals to value in matrix
The three following expressions: any(eq(A,gg)) any(A==gg) any(eq(0.9997,gg)) are the same and equal to 1. What is your...

6 years ago | 0

Answered
How to make a 3D bar graph for non-continuous data?
_I'm trying to make a 3D bar graph using the function bar3_ And it is not giving the desired result? What is wrong with: ...

6 years ago | 0

Answered
Solving large algebraic riccati-like problem
Why don't you use the matlab function for Riccati equation? See <https://fr.mathworks.com/help/control/ref/care.html>

6 years ago | 0

Answered
how to obtain the parameters of the step response within matlab?
Look at the <https://mathworks.com/help/control/ref/stepinfo.html stepinfo> command.

6 years ago | 0

Answered
How do I call a function from the MATLAB Editor into AppDesigner
I don't know exactly what you mean by "without changing the internals of the functions", but in the _CodeView_ of AppDesigner, y...

6 years ago | 0

Answered
Summing elements of an array
You can use either sum(cell2mat(P)) or sum([P{:}])

6 years ago | 0

Answered
How to use latex's \mathcal{Z} in the axis labels of a Matlab figure?
title('$\mathcal{Z}$','Interpreter','latex')

6 years ago | 2

Answered
How to create 4 axis on one single plot?
Maybe this <https://fr.mathworks.com/help/matlab/creating_plots/graph-with-multiple-x-axes-and-y-axes.html solution> is what you...

6 years ago | 0

Answered
Reshape and rearrange elements of a matrix
For your example, you could use something like this: A=[1 2 3 4 5 6; 7 8 9 10 11 12]; B=[reshape(A(:,1:end/2),2,3);reshap...

6 years ago | 0

Answered
How to take first character of Alphabet
One way to do it : regexpi(data,'[a-u]','match','once') ans = 7×1 cell array {'A'} {'A'} {'A'} ...

6 years ago | 0

Answered
help me loop i cant understand it
Try this to see if it is gets clear to you: for q1 = [1 2 -1;3 0 2] for q2 = [2 1] a = q2*q1; fpri...

6 years ago | 0

Answered
Combine three different set bar graphs in one graph
You can group your 3 bar graphs using something like this: b=bar([leak_22;leak_32;leak_45]); For your example, you will...

6 years ago | 0

Load more