Submitted

XMLNode

MATLAB class that allows you to use XPath to navigate and extract data from an XML document.

3 months ago | 5 downloads |

Submitted

File I/O C S-function Example

A simple C S-function which reads data from a file during simulation.

3 months ago | 7 downloads |

Answered

Spectrum Analyzer!! - How to access data/plots from a FFT scope real time

Simulink does allow you to access signal data from MATLAB during simulation via the use of runtime objects. Check out this doc ...

Spectrum Analyzer!! - How to access data/plots from a FFT scope real time

Simulink does allow you to access signal data from MATLAB during simulation via the use of runtime objects. Check out this doc ...

2 years ago | 0

| accepted

Answered

I'm not able to access my free training

To be able to log in to the _MATLAB Onramp_ course on MATLAB Academy, you must associate your MathWorks Account to your home lic...

I'm not able to access my free training

To be able to log in to the _MATLAB Onramp_ course on MATLAB Academy, you must associate your MathWorks Account to your home lic...

2 years ago | 0

Answered

Matlab Academy - Unable to login because the user has no entitled products

To be able to log in to the _MATLAB Onramp_ course on MATLAB Academy, you must have a MathWorks Account associated with a valid ...

Matlab Academy - Unable to login because the user has no entitled products

To be able to log in to the _MATLAB Onramp_ course on MATLAB Academy, you must have a MathWorks Account associated with a valid ...

2 years ago | 1

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

Answered

help using Xpath and XML reading

I may be misunderstanding things, but I think you may want to try doing something like this: dictExpr = xpath.compile('//di...

help using Xpath and XML reading

I may be misunderstanding things, but I think you may want to try doing something like this: dictExpr = xpath.compile('//di...

4 years ago | 0

| accepted

Answered

how to count key presses in limited time?

Oh, you need timer objects and a key press function brah! Also, you gotta stop thinking in loops and start thinking in callback...

how to count key presses in limited time?

Oh, you need timer objects and a key press function brah! Also, you gotta stop thinking in loops and start thinking in callback...

4 years ago | 0

| accepted

Answered

How to change values in XML file?

Working with XML can definitely be tricky! Fortunately, these kinds of things are pretty well documented... <http://www.w3sc...

How to change values in XML file?

Working with XML can definitely be tricky! Fortunately, these kinds of things are pretty well documented... <http://www.w3sc...

4 years ago | 0

| accepted

Answered

Need to create a 3 dimensional matrix of subjects, block numbers and 6 sub condition values within each block.

Is there a reason you want to store things in a 3-dimensional array? Seems you might be better off, at least at first, keeping ...

Need to create a 3 dimensional matrix of subjects, block numbers and 6 sub condition values within each block.

Is there a reason you want to store things in a 3-dimensional array? Seems you might be better off, at least at first, keeping ...

4 years ago | 0

| accepted

Solved

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

4 years ago

Solved

More luck than brains

Give a random function that guess and return numbers from 1 to 6 exactly like the test suite .

4 years ago

Solved

Determine if input is odd

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

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

4 years ago

Solved

Find the sum of all the numbers of the input vector

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

4 years ago

Solved

Most nonzero elements in row

Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

4 years ago

Solved

Swap the input arguments

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

4 years ago

Solved

Back and Forth Rows

Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

4 years ago

Solved

Find all elements less than 0 or greater than 10 and replace them with NaN

Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

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

4 years ago

Answered

Object composition and property updating

I think the way that I would do this is to set the actual properties to be private properties (SetAccess=private,GetAccess=...

Object composition and property updating

I think the way that I would do this is to set the actual properties to be private properties (SetAccess=private,GetAccess=...

4 years ago | 0

Answered

How to store and print comments from a script

Hmm... helpText = help('yourMATLABFileName') Also, you may then want to split each line into a separate string line...

How to store and print comments from a script

Hmm... helpText = help('yourMATLABFileName') Also, you may then want to split each line into a separate string line...

4 years ago | 0

Answered

Need to make a 4D plot (3D + Colour)

I'm curious how slice doesn't fit your needs. I'm no data visualization expert so please take this as an honest "I'd like to kn...

Need to make a 4D plot (3D + Colour)

I'm curious how slice doesn't fit your needs. I'm no data visualization expert so please take this as an honest "I'd like to kn...

4 years ago | 1

Answered

Usint integration to calculate the cylinder/rotary actuator flow rate instead of the derivative block

I assume you are using SimHydraulics, correct? Perhaps I am misunderstanding the question, but shouldn't you be able to use a...

Usint integration to calculate the cylinder/rotary actuator flow rate instead of the derivative block

I assume you are using SimHydraulics, correct? Perhaps I am misunderstanding the question, but shouldn't you be able to use a...

4 years ago | 1

Answered

Too many input arguments?

When I did stuff like this, I always just created a wrapper function that does the parameter passing. That would be replacing...

Too many input arguments?

When I did stuff like this, I always just created a wrapper function that does the parameter passing. That would be replacing...

4 years ago | 0

Answered

LTI data extraction

I believe you can use the bode function for that... [mag,phase,freqs] = bode(lin) Also, if you are comparing two systems...

LTI data extraction

I believe you can use the bode function for that... [mag,phase,freqs] = bode(lin) Also, if you are comparing two systems...

4 years ago | 0

| accepted

Answered

How to form this diagonal matrix?

m = 4; M = 1:m; diagVals = exp(j*2*pi*(M-1./M)) E = diag(diagVals) Is that right?

How to form this diagonal matrix?

m = 4; M = 1:m; diagVals = exp(j*2*pi*(M-1./M)) E = diag(diagVals) Is that right?

4 years ago | 0

| accepted

Answered

I am trying to make a s-function in my simulation. it consists of a c program. I have put this c program in matlab folder.But the simulation shows error and says that such a c program does not exist. s function does not allow us to specify the path name

Hmm... if you are writing an S-function by hand, then you should be able to add your other source files when you build it >...

I am trying to make a s-function in my simulation. it consists of a c program. I have put this c program in matlab folder.But the simulation shows error and says that such a c program does not exist. s function does not allow us to specify the path name

Hmm... if you are writing an S-function by hand, then you should be able to add your other source files when you build it >...

4 years ago | 0