matlab

Slickest REPL console in any language

Many languages of REPL consoles with additional features like autocomplete and intellisense. For instance, iPython, Mathematica, and PyCrust all make some effort to go beyond a basic read eval loop. REPLs are particularly useful in languages where interactive exploration is very important, such as Matlab or R. I'm looking for inspirat...

How do I create enumerated types in MATLAB?

Are there enumerated types in MATLAB? If not, what are the alternatives? ...

MATLAB: split long 2D matrix into the third dimension

Say I have the following matrix: A = randi(10, [6 3]) 7 10 3 5 5 7 10 5 1 6 5 10 4 9 1 4 10 1 And I would like to extract each 2 rows and put them into the third dimension, so the result would be like: B(:,:,1) = 7 10 3 5 5 7 B(:,:,2) =...

What Source Control Has MATLAB Integration?

I am using MATLAB R2008a and I want to know what source control has integration with it. I've heard Visual Source Safe is not so good. Does Subversion have integration with it? ...

How Do I Annotate Charts in MATLAB?

I've got a MATLAB script that is called every half hour to build a chart that is placed on my webpage: load ~/emailAnalysis/results.txt temp = results(:,3)-1238370000; h=plot(temp,results(:,1)) xlim([0,max(temp)-1]) ylim([0 max(results(:,1))]) set(gca,'XTick',[1:86400*7:(86400*max(temp))+1]) set(gca,'XTickLabel',[1:1:100]) set(gca,'XGri...

Is there a way to make imshow in octave behave more like Matlab?

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

MATLAB linked list

What are some possible ways to implement a linked list in MATLAB? Note: I am asking this question for pedagogical value, not practical value. I realize that if you're actually rolling your own linked list in MATLAB, you're probably doing something wrong. However, I'm a TA for a class that is MATLAB-intensive this semester, and my goa...

MATLAB testing framework

I am using MATLAB R2008a, what testing framework is available and what is recommended. the need for comprehensive from having to refactor a 5 kloc matlab application to Matlab oop. ...

Why is Matlab's inv slow and inaccurate ?

Hi! I read at a few places (in the doc and in this blog post : http://blogs.mathworks.com/loren/2007/05/16/purpose-of-inv/ ) that the use of inv in Matlab is not recommended because it is slow and inaccurate. I am trying to find the reason of this inaccuracy. As of now, Google did not give m interesting result, so I thought someone her...

Finding a specific character in a string in Matlab

Suppose I have a string called "[email protected]". I want to store the string before and after "@" into 2 separate strings. What would be the easiest method of finding the "@" character or other characters in the string? ...

Matlab strcat function troubles with spaces

I'm trying to accomplish this: strcat('red ', 'yellow ', 'white ') I expected to see "red yellow white", however, I see "redyellowwhite" on the command output. What needs to be done to ensure the spaces are concatenated properly? Thanks in advance. ...

MATLAB: showing an image in its original size

Can we show an image in its original size in MATLAB? Right now when we are showing, it is exactly fitted to the image window size. However, I want to show the image in its original size. When the image is of larger size, a scroll bar should appear in the image window. This would allow the user to view the image in its original size. A...

Get all pixel coordinates of a vector inside a image

Hi, i wonder if you guys know a solution (in matlab) to my problem: I have a intensity/greyscale image and i have choosen a pixel inside this image. Now want to send vectors starting from this pixel in all directions/angles and i want to sum up all the intensities of the pixels touching one vector, for all vectors. After this step i wo...

How do you output a line break in the command view in Matlab when running a m-file?

I have a m-file that outputs some calculations basically this: disp(['Value ', num2str(i)]); disp(x) disp(['Number of iterations ', num2str(iter)]) disp('----------') However this ouputs stuff rather messy in the command view which is really irritating when debugging the code. I would like to add a couple of line breaks to the output ...

How do I update the MATLAB path?

Sometimes when I add a new file to my path, I have to restart MATLAB or it won't be detected. There must be an other way to this! ...

MATLAB's Garbage Collector?

What is your mental model of it? How is it implemented? Which strengths and weaknesses does it have? MATLAB GC vs. Python GC? I sometimes see strange performance bottlenecks when using MATLAB nested functions in otherwise innocuously looking code, I am sure it is because of GC. Garbage Collector is an important part of VM and Mathworks ...

MATLAB excluding data outside 1 standard deviation

I'm inexperienced with MATLAB, so sorry for the newbie question: I've got a large vector (905350 elements) storing a whole bunch of data in it. I have the standard deviation and mean, and now I want to cut out all the data points that are above/below one standard deviation from the mean. I just have no clue how. From what I gather I hav...

Can I run MATLAB code on a web site?

I have a BE project whose code is in MATLAB but I need to present results on a web page. I want to know whether I can run my code directly on a web site? If not, could you tell me which language would be a better option? I'm thinking maybe ASP, HTML and PHP. ...

How do you generate tone frequencies in MATLAB?

I'm interested in producing a tone frequency at runtime with the frequency and duration being variable parameters. What would be the best way of generating this sound file in MATLAB and have it accessible in the script for use later to be concatenated with other sound files generated in a similar fashion for different frequencies/duratio...

matlab: correct approach to add geometrical objects to image

hi, please help with Matlab beginner challenge i need to create an image with few geometrical objects (circles, ellipses) and then to apply some projective transforms my problem is that i cant understand how to actually "drow" on image image is AFAIU generally defined as [X;Y;3] matrix, functions as SCIRCLE1 can compute/return collecti...