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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 1

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 1

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 38

| akzeptiert

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

mehr als 12 Jahre vor | 1

| akzeptiert

Gelöst


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

mehr als 12 Jahre vor

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 2

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

mehr als 12 Jahre vor | 0

Gelöst


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

mehr als 12 Jahre vor

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 1

| akzeptiert

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

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

mehr als 12 Jahre vor | 0

| akzeptiert

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

mehr als 12 Jahre vor | 0

| akzeptiert

Mehr laden