I think everyone would agree that the MATLAB language is not pretty, or particularly consistent. But nevermind! We still have to use it to get things done.
What are your favourite tricks for making things easier? Let's have one per answer so people can vote them up if they agree. Also, try to illustrate your answer with an example.
...
The following loop takes about 700 seconds to run in octave and 22 seconds to run in matlab when the DJI matrix has 21000 rows. How can I increase the efficiency of this?
for i=1:length(DJI)
DJI2(i,1)=datenum(char(DJI(i,2)),'yyyy-mm-dd');
end
...
I have the following code that I need to run over a matrix with over 20000 rows. It takes several minutes to run and the datenum and str2double functions appear to be the bottlenecks. Since no calculation depends on previous ones is there a way to break the loop into multiple parts and have them execute in parallel? Any advice on optimis...
I have several blocks of the following code that each use there own matrix. Is there a way to run each block in it's own thread rather then run all of them sequentially?
for i=1:length(DJI)
DJI2(:,1) = reshape(datenum(strvcat(DJI(:,2)(:)), length(DJI(:,2)),'yyyy-mm-dd'));
DJI2(:,2:6) = reshape(str2num(strvcat(DJI(:,3:7)(:)), length(DJI...
I have been unable to find a function in matlab or octave to do what I want.
I have a matrix m of two columns (x and y values). I know that I can extract the column by doing m(:,1) or m(:,2). I want to split it into smaller matricies of [potentially] equal size and and plot the mean of these matricies. In other words, I want to put th...
Hi,
I'm wondering if anyone has a 64-bit build of Octave? If so, do you know if it has full access to the 64 bit memory range -- i.e., can you create a matrix which uses up more than 4GB of memory?
Thanks,
Ben
...
Is it possible to set the window size / position of a plot window (figure)?
plot(0:20, sin(0:20))
Or is there any other possibility to change the size of the print() command?
print('aa.png', '-dpng')
Because the -Sxsize,ysize parameter doesn't change anything. The size of the written picture (aa.png) has always the same size as the...
Folks,
Matlab 2007b (7.5.0) has an avgpower function. See here:
"The avgpower method uses a rectangle approximation to the integral to
calculate the signal's average power using the PSD data stored in the
object.
"The avgpower method returns the average power of the signal which is
the area under the PSD curve."
Example invocation:
...
I'm looking for an Additive White Gaussian Noise generator for .NET.
I know that somewhere there is some degree of interoperability between .NET and MATLAB, which has a AWGN generator, but I don't know if its free EDIT and I just found it.
Probably other applications as GNU Octave, which have similar functionalities to MATLAB, have .NE...
I am using OdePkg in Octave to solve a system of stiff ODEs, e.g. by ode5r:
function yprime = myODEs(t,Y,param)
yprime = [
- param(1) * Y(1); # ODE for Y(1)
param(1) * Y(1) - param(2) Y(2) * Y(3); # ODE for Y(2)
param(2) Y(2) * Y(3) # ODE for Y(3)
...
I have an Excel file with a large set of data. The built-in graphs available in Excel are not enough to analyze these data, so I am thinking about using some tool like octave or R.
I was thinking about some method to load an Excel file directly into octave or R. I searched the web and found that many people have succeeded using by expor...
I'm looking for a non-linear curve fitting routine (probably most likely to be found in R or Python, but I'm open to other languages) which would take x,y data and fit a curve to it.
I should be able to specify as a string the type of expression I want to fit.
Examples:
"A+B*x+C*x*x"
"(A+B*x+C*x*x)/(D*x+E*x*x)"
"sin(A+B*x)*exp(C+D*x)+...
Is there an Emacs major mode for MATLAB and / or Octave files? For those who don't know, MATLAB files generally have a ".m" file extension.
My primary interest is GNU Emacs but XEmacs tips would also be appreciated.
...
Greetings,
I'm the only person in my Numerical Analysis class attempting to do all of the MatLab based homework assignments in Octave - the opensource representation of MatLab.
However, I'm having problems getting graphs to plot and I think it's a simple linking problem. I am running:
-Mac OS X Snow Leopard (10.6)
-Octave 3.2.2
-Aqua...
A friend of mine asked me if it would be possible to port the Octave project to the iPhone. I haven't compiled an external package for an iPhone project before, so I downloaded the source code, and then used some scripts found on a couple of different Web sites (one, two) to try and build the libraries. However, when I try either of thes...
Hello,
I'm currently migrating some computer vision work I'd previously been doing in Matlab to Octave. For the most part, it's been a smooth transition, except for one annoyance.
I often use the imshow() procedure to view an image. In the viewer I get in Matlab, I'm able to inspect individual pixels to see their value. For example,...
Background:
I want to be able to take a 2d matrix (an image really), and a set of points defining a polygon, and draw that polygon into the matrix.
Before I run off and reinvent the wheel, I thought I'd ask if anyone knew of any existing libraries or code in Octave that does this. So far, my searches through the Octave packages and ...
How can I do Mathematica-style
a = Table[2^(2 k) + 1, {k, 1, 3}]
Last[a], First[a]
Append[a,3]
in Octave?
...
In GNU Octave you can make a picture where different colors represent different values in a matrix. You can also add a colorbar, which shows what color corresponds to what value.
Is it possible to somehow add units to the values shown in the colorbar? Instead of saying “0.36” it would say “0.36 V/nm”? I know this is possible in Matlab, ...
Octave appears to assume that a specific sound playing utility will be available on a system but doesn't seem to provide the ability to specify an alternate. In the error below, Octave is looking for ofsndplay, which is not a utility available on all systems.
octave:38> sound(beamformed_20)
sh: ofsndplay: command not found
I...