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

más de 12 años hace | 0

| aceptada

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

más de 12 años hace | 1

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

más de 12 años hace | 0

| aceptada

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

más de 12 años hace | 0

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

más de 12 años hace | 1

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

más de 12 años hace | 0

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

más de 12 años hace | 38

| aceptada

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

más de 12 años hace | 1

| aceptada

Resuelto


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

más de 12 años hace

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

más de 12 años hace | 0

| aceptada

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

más de 12 años hace | 0

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

más de 12 años hace | 0

| aceptada

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

más de 12 años hace | 0

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

más de 12 años hace | 2

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

más de 12 años hace | 0

Resuelto


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

más de 12 años hace

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 1

| aceptada

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

| aceptada

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

más de 12 años hace | 0

| aceptada

Cargar más