I am a Matlab and Simulink enthusiast. Trying to catch up with this awesome community out of my personal interest.

(Disclaimer: The comments posted in the forum are my own perspectives, and in no-way reflects opinion of MathWorks as a company!)

Channel

Audio Sensor Set 2

Thingspeak channels for Sensors 6-10 in the grid. #MW-IN-HackDay2016

3 years ago

Channel

Audio Sensor Set 1

Thingspeak channels for Sensors 1-5 in the grid. #MW-IN-HackDay2016

3 years ago

Answered

How do i get the editor window to open above the command window and not in a new separate one?

<</matlabcentral/answers/uploaded_files/58943/docking_editor.JPG>>

How do i get the editor window to open above the command window and not in a new separate one?

<</matlabcentral/answers/uploaded_files/58943/docking_editor.JPG>>

3 years ago | 4

Answered

Cell array, string concatenation

function outString = myStringConcatenator(inString1, inString2) minLength = min(length(inString1), length(inString2));...

Cell array, string concatenation

function outString = myStringConcatenator(inString1, inString2) minLength = min(length(inString1), length(inString2));...

3 years ago | 0

Solved

Pizza!

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

3 years ago

Submitted

Automated Simulink Model Creator from Ordinary Differential Equation

This app automatically creates a Simulink model from an ODE

3 years ago | 106 downloads |

Answered

How to replace two for loops with matrix expression

You may directly use "vectorization" and "element-wise operation to solve this : Here is an example code - %% Assumption...

How to replace two for loops with matrix expression

You may directly use "vectorization" and "element-wise operation to solve this : Here is an example code - %% Assumption...

3 years ago | 0

Answered

How can I set Values to Simulink Block from my Workspace?

To get the list of parameters associated with 'PID Controller' block, I would use the below command : allParams = get_param...

How can I set Values to Simulink Block from my Workspace?

To get the list of parameters associated with 'PID Controller' block, I would use the below command : allParams = get_param...

4 years ago | 0

| accepted

Answered

choose one out of every 8 elements randomly

m = 100; spacedIds = [0:8:m]; rands = randi(8, 1, size(spacedIds,2)-1); randIds = spacedIds(1:end-1)+ rands; %...

choose one out of every 8 elements randomly

m = 100; spacedIds = [0:8:m]; rands = randi(8, 1, size(spacedIds,2)-1); randIds = spacedIds(1:end-1)+ rands; %...

4 years ago | 0

Solved

Remove any row in which a NaN appears

Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

4 years ago

Solved

Distance walked 1D

Suppose you go from position 7 to 10 to 6 to 4. Then you have walked 9 units of distance, since 7 to 10 is 3 units, 10 to 6 is 4...

4 years ago

Answered

importing an excel table with words

'xlsread' returns 3 outputs - [numOnly, textOnly, rawDataInCellArray] = xlsread(xlFile); If you need the data in only...

importing an excel table with words

'xlsread' returns 3 outputs - [numOnly, textOnly, rawDataInCellArray] = xlsread(xlFile); If you need the data in only...

4 years ago | 1

| accepted

Answered

Converting cell components into strings for moving files

Replace the line calling 'movefile' by a cell-function. Like this - cellfun(@(C) movefile(C, destination), source)

Converting cell components into strings for moving files

Replace the line calling 'movefile' by a cell-function. Like this - cellfun(@(C) movefile(C, destination), source)

4 years ago | 0

| accepted

Answered

How to extract a specific value within given range and row and column number which has a specific value.

>> randMatrix = (0.02*rand(5,1) - 0.01); % A random 5x1 matrix >> [~, id] = min(abs(randMatrix - 0.003)); This would wor...

How to extract a specific value within given range and row and column number which has a specific value.

>> randMatrix = (0.02*rand(5,1) - 0.01); % A random 5x1 matrix >> [~, id] = min(abs(randMatrix - 0.003)); This would wor...

4 years ago | 0

Answered

find a value in a matrix

I wasn't sure if you want the actual output in terms of 'x*' or the corresponding index. >> inputMat = [2 3 4; 5 -2 -5; -6 -...

find a value in a matrix

I wasn't sure if you want the actual output in terms of 'x*' or the corresponding index. >> inputMat = [2 3 4; 5 -2 -5; -6 -...

4 years ago | 0

| accepted

Answered

how to find max and min value from .mat file and save it to an other array?

Looks like the input array is already being sorted before saving into matfile. Now all you have to do is load the file, and get ...

how to find max and min value from .mat file and save it to an other array?

Looks like the input array is already being sorted before saving into matfile. Now all you have to do is load the file, and get ...

4 years ago | 0

Solved

Find the numeric mean of the prime numbers in a matrix.

There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

4 years ago

Solved

Is this triangle right-angled?

Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

4 years ago

Answered

How to display a tf function in the command window frm simulink??

If your model is loaded, you can access the parameter values for a block using "get_param" api. Say, you have a model "myMode...

How to display a tf function in the command window frm simulink??

If your model is loaded, you can access the parameter values for a block using "get_param" api. Say, you have a model "myMode...

4 years ago | 0

Answered

How to select two (or more) different ranges using xlsread

You can patch the function, or write a new one to get the functionality: Example: [x,y,z] = xlsreadPatch('test.xlsx', '...

How to select two (or more) different ranges using xlsread

You can patch the function, or write a new one to get the functionality: Example: [x,y,z] = xlsreadPatch('test.xlsx', '...

4 years ago | 0

Answered

How to find the median of one part of a column being in a while loop?

Is this what you're looking for? A1=[1950 0;1951 0;1952 0;1953 0;1954 0;1955 0]; A2=[1960 1;1961 2;1962 3;1963 4;195...

How to find the median of one part of a column being in a while loop?

Is this what you're looking for? A1=[1950 0;1951 0;1952 0;1953 0;1954 0;1955 0]; A2=[1960 1;1961 2;1962 3;1963 4;195...

4 years ago | 1

Answered

Count number of changes to 1

If you're only counting the changes 0 -> 1 , then it would be the number of occurrences of 1 (1-0) in the diff vector. >> A ...

Count number of changes to 1

If you're only counting the changes 0 -> 1 , then it would be the number of occurrences of 1 (1-0) in the diff vector. >> A ...

4 years ago | 0

Solved

Reverse the vector

Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

4 years ago

Solved

Compute the step response of a DC motor

Compute the step response of a DC motor shown below <<http://blogs.mathworks.com/images/seth/cody/dc-motor.png>> The param...

4 years ago

Solved

Model a simple pendulum

Model a simple pendulum of length 200cm with bob of mass 100g and plot the position in degrees. The pendulum starts at 30 degree...

4 years ago

Solved

Produce a Fibonacci sequence

Construct a diagram that generates the Fibonacci sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34.....up to 377 The Fibonacci sequ...

4 years ago

Solved

Make a low pass filter

Make a first order low pass filter that will filter out the high frequency oscillations for the given input signal. The cut-off ...

4 years ago

Solved

Model a mass spring system

Model an ideal mass-spring system shown below where the spring is initially stretched. <<http://blogs.mathworks.com/images/se...

4 years ago

Solved

Model a falling body

An object is falling freely from a height of 22 meters under the force of gravity. <<http://blogs.mathworks.com/images/seth/c...

4 years ago