Solved

Roll the Dice!

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

11 years ago

Solved

Fibonacci sequence

Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

11 years ago

Solved

radius of a spherical planet

you just measured its surface area, that is the input.

11 years ago

Solved

Is my wife right? Now with even more wrong husband

Again, as in "Is my wife right?" ( <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right> ), answer 'yes' r...

11 years ago

Solved

Too mean-spirited

Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

11 years ago

Solved

How to find the position of an element in a vector without using the find function

Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

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

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

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

11 years ago

Solved

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

11 years ago

Answered

Randomly Choose number from a matrix of several numbers?

Instead of starting with your code - I will give an example of how I would do it. Hopefully this can see how you implement it i...

Randomly Choose number from a matrix of several numbers?

Instead of starting with your code - I will give an example of how I would do it. Hopefully this can see how you implement it i...

11 years ago | 0

Answered

Controlling Dll files from Matlab

First step is to see if you can use loadlibrary interface in MATLAB. See this section of the documentation on how to call C ...

Controlling Dll files from Matlab

First step is to see if you can use loadlibrary interface in MATLAB. See this section of the documentation on how to call C ...

11 years ago | 0

Answered

Loops are slow inside spmd blocks!!

Looks like loops inside parfor/spmd with tons of iterations are not getting all the benefit from JIT (Just-in-Time interpreter/c...

Loops are slow inside spmd blocks!!

Looks like loops inside parfor/spmd with tons of iterations are not getting all the benefit from JIT (Just-in-Time interpreter/c...

11 years ago | 0

Answered

Writing a cell array to excel but skipping certain values

I think it is clear what you want to do- I don't have MATLAB open, so forgive minor syntax issues. 1. Step one extract the ...

Writing a cell array to excel but skipping certain values

I think it is clear what you want to do- I don't have MATLAB open, so forgive minor syntax issues. 1. Step one extract the ...

11 years ago | 1

Answered

export to excel

This should work out for you. Reshape the array so it is an nx*ny by 4 and then use the xlswrite command. A = rand(18,30...

export to excel

This should work out for you. Reshape the array so it is an nx*ny by 4 and then use the xlswrite command. A = rand(18,30...

11 years ago | 0

| accepted

Answered

CPU ID and EXE

You can run any command to the operating system via the bang (!) command, something like this (for a Windows machine) will give ...

CPU ID and EXE

You can run any command to the operating system via the bang (!) command, something like this (for a Windows machine) will give ...

11 years ago | 0

Answered

How to autoload a custom function in cftools

I believe what you want to do is to highlight the data you don't want to fit using the "outlier" tool. <http://www.mathwork...

How to autoload a custom function in cftools

I believe what you want to do is to highlight the data you don't want to fit using the "outlier" tool. <http://www.mathwork...

11 years ago | 0

Answered

How to autoload a custom function in cftools

A couple of options for you. 1. You can autogenerate the code to do the fit from cftool. Then you can repeat the analysis wit...

How to autoload a custom function in cftools

A couple of options for you. 1. You can autogenerate the code to do the fit from cftool. Then you can repeat the analysis wit...

11 years ago | 0

| accepted

Answered

Changing a single element in sparse matrices

In general, it is useful to define the values and locations of the non-zero entries of your sparse matrices - and then only crea...

Changing a single element in sparse matrices

In general, it is useful to define the values and locations of the non-zero entries of your sparse matrices - and then only crea...

11 years ago | 0

Answered

Semilogy Plot not showing minor tick marks

The X Minor ticks are off by default. This should turn them back on. ax = gca; % grabs current axis set(ax,'XMinorTi...

Semilogy Plot not showing minor tick marks

The X Minor ticks are off by default. This should turn them back on. ax = gca; % grabs current axis set(ax,'XMinorTi...

11 years ago | 0

Answered

Running MATLAB from Excel - Matlab Builder Ex or Matlab Spredsheet link EX?

It basically breaks down to if you want the end user who is running the model within Excel to have MATLAB or not. Spreadshe...

Running MATLAB from Excel - Matlab Builder Ex or Matlab Spredsheet link EX?

It basically breaks down to if you want the end user who is running the model within Excel to have MATLAB or not. Spreadshe...

11 years ago | 1

| accepted

Answered

Parallel for loop: Using broadcasting array variable values as indexes

For parfor loops, when you index into a sliced variables, restrictions are placed on the first-level variable indices. This allo...

Parallel for loop: Using broadcasting array variable values as indexes

For parfor loops, when you index into a sliced variables, restrictions are placed on the first-level variable indices. This allo...

11 years ago | 2

| accepted

Answered

memmapfile in parfor loops

You should be able to use memmapfile in a parfor loop. The trick is to pass m into a function within the parfor loop. You can g...

memmapfile in parfor loops

You should be able to use memmapfile in a parfor loop. The trick is to pass m into a function within the parfor loop. You can g...

11 years ago | 3

Answered

plot integral

This can be done using cumtrapz -- Doc here: <http://www.mathworks.com/help/releases/R2011a/techdoc/ref/cumtrapz.html> ...

plot integral

This can be done using cumtrapz -- Doc here: <http://www.mathworks.com/help/releases/R2011a/techdoc/ref/cumtrapz.html> ...

12 years ago | 4

Answered

How to brush data automatically?

Only certain plots can be brushed. The doc has list here of what you can and can't brush: <http://www.mathworks.com/help/release...

How to brush data automatically?

Only certain plots can be brushed. The doc has list here of what you can and can't brush: <http://www.mathworks.com/help/release...

12 years ago | 1

Answered

how to open 3D image from a series of 2D image?

This demo using MRI data should help you get started: <http://www.mathworks.com/help/releases/R2011a/techdoc/visualize/f5-329...

how to open 3D image from a series of 2D image?

This demo using MRI data should help you get started: <http://www.mathworks.com/help/releases/R2011a/techdoc/visualize/f5-329...

12 years ago | 2

Answered

parallel computing with scheduler Comsol-Matlab

COMSOL helped me with a similar issue about a year ago. Their answer is below. I would encourage you to contact them. They were...

parallel computing with scheduler Comsol-Matlab

COMSOL helped me with a similar issue about a year ago. Their answer is below. I would encourage you to contact them. They were...

12 years ago | 2

Answered

several slices of a 2D-image interpolate to 3D

This demo is probably a good first start for you. Displaying MRI Data: <http://www.mathworks.com/help/techdoc/visualize/...

several slices of a 2D-image interpolate to 3D

This demo is probably a good first start for you. Displaying MRI Data: <http://www.mathworks.com/help/techdoc/visualize/...

12 years ago | 0