Answered

How to reshape this matrix?

Test matrix A = rand(2,3,3); Solution #1 D = reshape(permute(A, [1 3 2]), [6 3]) Solution #2 B = mat2cell(A, ...

How to reshape this matrix?

Test matrix A = rand(2,3,3); Solution #1 D = reshape(permute(A, [1 3 2]), [6 3]) Solution #2 B = mat2cell(A, ...

8 years ago | 0

| accepted

Answered

arduino IO package simulink

The ArduinoIO Package and the Arduino Target use different Simulink blocks, and are entirely separate implementations. * To u...

arduino IO package simulink

The ArduinoIO Package and the Arduino Target use different Simulink blocks, and are entirely separate implementations. * To u...

8 years ago | 1

Answered

Lego Mindstorm installation problem

I assume you are referring to the <http://www.mathworks.com/products/simulink/simulink-targets/ Run on Target Hardware> capabili...

Lego Mindstorm installation problem

I assume you are referring to the <http://www.mathworks.com/products/simulink/simulink-targets/ Run on Target Hardware> capabili...

8 years ago | 0

| accepted

Answered

Simulink, MS Visual Studio and Lego NXT

I assume you are referring to the <http://www.mathworks.com/products/simulink/simulink-targets/ Run on Target Hardware> capabili...

Simulink, MS Visual Studio and Lego NXT

I assume you are referring to the <http://www.mathworks.com/products/simulink/simulink-targets/ Run on Target Hardware> capabili...

8 years ago | 0

Answered

Arduino Interrupts

I assume you are referring to the <http://www.mathworks.com/products/simulink/simulink-targets/ Run on Target Hardware> support ...

Arduino Interrupts

I assume you are referring to the <http://www.mathworks.com/products/simulink/simulink-targets/ Run on Target Hardware> support ...

8 years ago | 1

Solved

Summing digits

Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

8 years ago

Solved

Make a checkerboard matrix

Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Example...

8 years ago

Solved

Swap the first and last columns

Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

8 years ago

Solved

Return the largest number that is adjacent to a zero

This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

8 years ago

Solved

Determine whether a vector is monotonically increasing

Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

8 years ago

Solved

Find the longest sequence of 1's in a binary sequence.

Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

8 years ago

Solved

Select every other element of a vector

Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

8 years ago

Solved

Determine if input is odd

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

8 years ago

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

8 years ago

Answered

Ploting analog input in real time

It is possible that one of your plots is being overwritten by the other plot. The standard plot command (plot(x,y)) uses the cur...

Ploting analog input in real time

It is possible that one of your plots is being overwritten by the other plot. The standard plot command (plot(x,y)) uses the cur...

8 years ago | 1

Answered

3d animation using virtual reality

Take a look at <http://www.mathworks.com/products/3d-animation/ Simulink 3D Animation>. It allows you to load in and visualize a...

3d animation using virtual reality

Take a look at <http://www.mathworks.com/products/3d-animation/ Simulink 3D Animation>. It allows you to load in and visualize a...

9 years ago | 0

Answered

Mex function -Error:Module could not be found-Checked with dependency walker and added the folder to the path but still the same problem

Make sure that the Visual C++ compiler that you are using is one of the <http://www.mathworks.com/support/compilers/R2011a/win32...

Mex function -Error:Module could not be found-Checked with dependency walker and added the folder to the path but still the same problem

Make sure that the Visual C++ compiler that you are using is one of the <http://www.mathworks.com/support/compilers/R2011a/win32...

9 years ago | 0

Answered

get values proportional to most occurence

You can use the FIND command to identify indices that match a criterion. For example: x = ceil(rand(1,5000)*100); % make...

get values proportional to most occurence

You can use the FIND command to identify indices that match a criterion. For example: x = ceil(rand(1,5000)*100); % make...

9 years ago | 1

| accepted

Answered

Utilizing Matlab for Teaching Applied Calculus for Engineering Technology

Here are some relevant items: * <http://www.mathworks.com/academia/classroom-resources/search.html?term=circuits Classroom ...

Utilizing Matlab for Teaching Applied Calculus for Engineering Technology

Here are some relevant items: * <http://www.mathworks.com/academia/classroom-resources/search.html?term=circuits Classroom ...

9 years ago | 1

Answered

converting m-file to c-code

If you just want to convert MATLAB code to C code, you don't need to create a Simulink block. You can just create a MATLAB fun...

converting m-file to c-code

If you just want to convert MATLAB code to C code, you don't need to create a Simulink block. You can just create a MATLAB fun...

9 years ago | 2

| accepted

Answered

simulink model from matrix

Hi Tomas, You can write a MATLAB function that takes the matrix and uses the Simulink API to automatically create, save, and ...

simulink model from matrix

Hi Tomas, You can write a MATLAB function that takes the matrix and uses the Simulink API to automatically create, save, and ...

9 years ago | 2

| accepted