A résolu


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

environ 12 ans il y a

A résolu


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

environ 12 ans il y a

A résolu


Add two numbers
Given a and b, return the sum a+b in c.

environ 12 ans il y a

A résolu


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

environ 12 ans il y a

A résolu


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

environ 12 ans il y a

A résolu


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

environ 12 ans il y a

A résolu


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

environ 12 ans il y a

Question


Which MATLAB blogs should I follow?
I would like a list of blogs related to MATLAB to use for my own reading and to recommend to others. The blogs can be introduct...

environ 12 ans il y a | 3 réponses | 3

3

réponses

Réponse apportée
Loading images from a .MAT file
The code shown only saves the names of the image files and not the image data itself. This is because the variable 'ListOfImage...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
How do I use 'ErrorHandler' in arrayfun?
Rather than use ErrorHandler here, consider writing your logic into a function that acts on a scalar struct. This function woul...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
How can you create an empty table object with non-zero rows or non-zero columns?
You can use cell2table to initialize an empty table by providing a cell array of desired dimensions. For example, this initiali...

environ 12 ans il y a | 4

Réponse apportée
Looking for an example showing short-cirkuit (&&) superior to normal (&) operation
The short-circuiting behavior of && is occasionally useful for performance optimization. If you use more intensive conditions, ...

environ 12 ans il y a | 0

Réponse apportée
How to access .exe file through matlab .m file?
You can use the SYSTEM command to execute a .exe file and capture its program output in MATLAB. doc system

environ 12 ans il y a | 0

| A accepté

Réponse apportée
How to comment out unused arguments in function header
Consider writing your functions to take parameter/value pairs. By doing this, you could define optional parameters that don't n...

environ 12 ans il y a | 1

| A accepté

Réponse apportée
How can I add a Counter block by M file script ?
To find the source address of a block to use with add_block, first browse the Simulink Library Browser to get to your block. Fo...

environ 12 ans il y a | 1

| A accepté

Réponse apportée
Importing vector from workspace to simulink then conditionally use them (Communication related)
I would first suggest the Switch block in the Simulink Signal Routing library. This would allow you to switch between two signa...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
Run Javascript from MATLAB
You cannot directly execute a JavaScript file in MATLAB. However, if you can set up a web server with a page that executes your...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
Is the "timer" function deployable in Matlab 6.5 (Release 13)
The TIMER function was not deployable in MATLAB 6.5 since it creates an object. In the _Limitations and Restrictions_ section o...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
cell array conversion to numeric array
My guess is that your cell array is 2D but contains empty values so that when CELL2MAT attempts to take each cell row and create...

environ 12 ans il y a | 0

Réponse apportée
How can I setup masked subsystems to have a gradient color background?
In the Mask Editor, the first tab _Icon & Ports_ allows you to define the block icon. The bottom of the tab shows what drawing ...

environ 12 ans il y a | 1

Réponse apportée
Getting information through mex about caller workspace variables
In MATLAB, I would use WHOS to inspect the workspace for variables. If I was writing a function and needed to inspect the calle...

environ 12 ans il y a | 1

Réponse apportée
Quicker alternative to EVAL
I would suggest trying a few approaches and seeing which is fastest with TIC/TOC. For more advanced performance debugging, use ...

presque 14 ans il y a | 1

Réponse apportée
Object composition and property updating
You should think about whether the tire needs to be exposed as a public property on the car, or whether it can be private. In a...

presque 14 ans il y a | 1

| A accepté

Réponse apportée
Reference Application API via Matlab
MATLAB has an API for COM objects that you might try. See <http://www.mathworks.com/help/techdoc/matlab_external/brd4at8.html U...

presque 14 ans il y a | 0

Réponse apportée
Constant, Persistent value, and profile versioning
One option is to use a CONSTANT property assigned to an object instance. See the doc <http://www.mathworks.com/help/techdoc/mat...

presque 14 ans il y a | 2

| A accepté

Réponse apportée
filter an array of objects based on the value of a string property
You can create a logical mask using ARRAYFUN, where you execute a function on each object that returns true if the object is the...

presque 14 ans il y a | 0

Réponse apportée
c# integration with Matlab
Can you call your C# program using MATLAB's <http://www.mathworks.com/help/techdoc/matlab_external/brpb5k6.html .NET interface>?...

presque 14 ans il y a | 0

Réponse apportée
Plotting two 3D figures (mesh,surf) - set different parameters
There are lots of properties for a surface object that allow you to control transparency. You can also use ALPHA to quickly...

presque 14 ans il y a | 2

| A accepté

Réponse apportée
looking for a function like integral2
You are probably using an older version of MATLAB. The INTEGRAL2 function was added along with INTEGRAL and INTEGRAL3 in R2012a...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
Shrink a 1-D array (vector) by removing all the columns with a value of zero
Here is a good solution: NewSimpleArray = SimpleArray(SimpleArray ~= 0)

presque 14 ans il y a | 9

| A accepté

Charger plus