Answered
How to change a matrix as inserting zeroes both end sides?
There's a |gallery| for that! az = rand(10,3); Az2 = full(gallery('tridiag',az(2:end,1),az(:,2),az(1:end-1,3))) And ...

12 years ago | 0

| accepted

Answered
Converting Fortran to MATLAB
Gerrit, You might be able to avoid reinventing the wheel by using the MEX api. This will let you compile your fortran code y...

12 years ago | 1

Answered
Set timer to display sth in certain interval
T = timer('Period',0.01,... %period 'ExecutionMode','fixedRate',... %{singleShot,fixedRate,fixedSpacing,fixedDelay}...

12 years ago | 0

| accepted

Answered
3D view Fish-eye distortion
Just a thought: It's _possible_ one of the projections in the Mapping Toolbox might work for this: <http://www.mathworks.com/...

12 years ago | 0

Answered
Errors returned from skewness and kurtosis
It sounds like you have your own |nanmean| function shadowing the Statistics Toolbox' |nanmean| which -all nanmean Will ...

12 years ago | 1

Answered
Even and Odd parts
signal = rand(1000,1); even = signal(2:2:end); odd = signal(1:2:end); Like this?

12 years ago | 0

Answered
How to get 'type' of a variable in matlab?
To get the data type, or class, of a variable, use the “class” function. x = 100; class(x) To determine if a variable has a s...

12 years ago | 38

| accepted

Answered
Concatening symbols and strings on axis label
E.g: >> xlabel('It''s Friday evening, I shouldn''t be on here$\dot{d}$','interpreter','latex')

12 years ago | 1

| accepted

Solved


Remove the middle element from a vector
Remove the middle element of a vector? *Example:* [1,2,3] should return 2 [1,2,3,4] should return 2 [] should return...

12 years ago

Answered
How to make MATLAB ignore indices that are out of bounds for a matrix
One way (of many): Use |min()| and |max()| to figure out when the range is outside: idx = -2:12; %indices outside of ran...

12 years ago | 0

| accepted

Answered
Function/method to truncate the fractional part of a number in Matlab
Well, for _display_ purposes you can do it the same way as you do in C by passing a format specifier into |fprintf| or |sprintf|...

12 years ago | 0

Answered
how to use randomMatrix properly
This is a MuPad command. To run it, open a MuPad note book and run it there: mupad %or click the app. And for more info...

12 years ago | 0

| accepted

Answered
Multiplying unequal length vectors
Well what do you want to do? Do you want to multiply f(theta) by every element of phi? If so: exp(ii.*phi)'*(1:351) ...

12 years ago | 0

Answered
How to stop a function
|return| only returns out of the innermost function. Thus is it jumps out of your ode function, function1, but not out of the s...

12 years ago | 2

Answered
Problem with "datetick" on plot
The first input to |datetick()| should be the axis to plot on on. For example: x = floor(now)-200:floor(now)+200; %dates...

12 years ago | 0

Solved


Palindrome
Check if a given string is a palindrome or not. For example, a = 'amoreroma' is a palindrome. But b = 'xyz' is not. Return...

12 years ago

Answered
For loop help needed
Use the debugger! * Put this in a script or function and save the file. * Put a break point on the first line (click on the ...

12 years ago | 0

Answered
Data driven Unit Tests
I think if I was going to do this, I would have a separate class that contains the list of files and a |run()| method. This...

12 years ago | 0

Answered
hold all warning in command line
# Put a |try/catch| around your code that is throwing the error. # Use |MException.last| to retrieve the last error. try ...

12 years ago | 0

Answered
Vectorization of matrices power
This should give you the tools you need: x = (1:3).^(1:3) xm = tril(toeplitz(x))

12 years ago | 0

Answered
zscore of an array with NaN's?
I think any function that will calculate the zscore will inevitably have to remove the nans. You may find |nanvar|, |nanmean|...

12 years ago | 0

Answered
Matrix algebra very slow on GPU
How are you doing the timing? If upgrading is an option, in R2013b, we released |gputimeit| which will give better measuremen...

12 years ago | 0

Answered
Can this GPU code snippet be redone without nested loops?
Is _output_ preallocated? Before the loops: output = gpuArray.zeros(x,y); This should speed it up dramatically.

12 years ago | 0

Answered
Accelerating array generation, when composed of square tiles from expensive function
I don't have time to look into this too much today or tomorrow, here are a few tips * Avoid using |cell|-arrays with |parfor...

12 years ago | 0

Answered
handle tick line in 3D mesh plot
As in modifying the _'LineWidth'_ of a mesh plot? h = mesh(magic(5)); set(h,'LineWidth',3); If not, please clarify the ...

12 years ago | 1

| accepted

Answered
How can I read only selected frames of a video without using a loop?
I would just use a |for|-loop and loop over the values you want to read specifying each at a time. idx = [567 580:590]; fo...

12 years ago | 0

Answered
Duplicated elements in a GUI
Absolutely. You can go into GUIDE and use the property inspector to change the callback manually. Copy the callback from t...

12 years ago | 0

Answered
Random integers (no permutation)
Use |randperm| with _'k'_ option randperm(10,3) And for more info: doc randperm

12 years ago | 0

Answered
How can i make a changeable function input in a matlab function.
Sure. You'll need to use function handles. <http://www.mathworks.com/help/releases/R2013b/matlab/ref/function_handle.html>...

12 years ago | 0

| accepted

Answered
Automatic comments done by GUIDE
You can turn off "Generate Callback Prototypes" in: GUIDE -> Tools -> GUI Options But this will then not generate _anyth...

12 years ago | 0

| accepted

Load more