matlab

How to read data from a repeated format of a large text file in MATLAB?

I want to read data of average saturation (%) for water as shown below. This data is a partial form of a large file, however the average water saturation (%) REPEATS itself in the given format only. Average Pressure Total Pore Volume psia 3884.9 ...

TCP/IP communication in Matlab

Hello I want to build my own Matlab cluster from lots of junk computers. Anybody knows how to send data from one Matlab to another over TCP ? I need to send image chunks / .mat files and variables. Thanks, SW ...

Hash tables in Matlab

Does Matlab have any support for hashtables? Some background I am working on a problem in Matlab that requires a scale-space representation of an image. To do this I create a 2-D Gaussian filter with variance sigma*s^k for k in some range., and then I use each one in turn to filter the image. Now, I want some sort of mapping from k ...

Given a vector a=[1,2, 3.2, 4, 5] and an element x=3 In vector a, how to find the exact entry which is bigger than x?

Given a vector a=[1,2, 3.2, 4, 5] and an element x=3 In vector a, how to find the exact entry which is bigger than x? ...

matlab - plot 2D rectangle with interpolated color

I want to plot a 2d rect (using the rectangle function is good enough for my needs), but with a linearly interpolated color, i.e at the bottom it should be red, at the top blue, and between the two there should be the linear interpolation of the two colors. How can I do this? ...

other problems with data acquisition from MATLAB

3 days ago I asked for help in acquiring data from a text file generated by a C program (. Exe). Thanks to the programmer "second" I solved the problem but yesterday I discovered that the output file is more complex than I had expected. I also ask you help. The file output is: V|0|0|0|t|0|1|1|4|11|T4|H13|||||||||||| P|40|0.01...

MATLAB code question

I am working on converting a MATLAB program to C and I don't know MATLAB at all. Can anyone tell me what the '/ does in MATLAB? var1=acos(v1true*varW1'/(norm(v1true))); I know what ./ does, it causes MATLAB to divide term by term. But I don't know about '/ Thanks, DemiSheep ...

Attempting to create iterations with MATLAB (beginner)

Hi all, I'm very very new to Matlab and I tried to attempt at making a simple iteration script. Basically all I wanted to do was plot: 1*sin(x) 2*sin(x) 3*sin(x) ... 4*sin(x) And this is the program that I wrote: function test1 x=1:0.1:10; for k=1:1:5; y=k*sin(x); plot(x,y); end % /for-loop end % /test1 However, it only pl...

MATLAB round function - how does it round .5 up or down??

How does MATLAB's round function work with .5? Like 5.5? Does it round up to 6, or round down to 5? The Mathworks page talking about this function says nothing about this, and the example doesn't help either! Here is the mathworks page for the MATLAB round function: mathworks round function page ...

Is there a C rounding function like MATLAB's round function?

I need a C rounding function which rounds numbers like MATLAB's round function. Is there one? If you don't know how MATLAB's round function works see this link: MATLAB round function I was thinking I might just write my own simple round function to match MATLAB's functionality. Thanks, DemiSheep ...

Printing a MATLAB plot in exact dimensions on paper

I have a plot that needs to be printed out in exact dimensions on paper, since it is in scale and from it on paper some things will be measured. What would be the easiest (is it possible at all) way to do it? ...

3D bar and y-axis labeling

Dear all, I have a 3D plot like this: In the Y-axis of the plot, each group of three bars refer to the same parameters: x1, x2, x3. I would like to have a spacing in the y-axis for each group of three bars, so that it becomes more clear that those bars are referring to the same parameters. At the same time, I would like to put a labe...

Matlab - run file without opening GUI, then quit

I want Matlab to run some .m file, which writes to a text file. I don't want the GUI to launch, and I don't want the command line interpreter to run. I've got matlab -nodisplay -r myfile But this still runs the interpreter. What options should I be using? ...

Add legend outside of axes without rescaling in MATLAB

I've got a GUI in MATLAB with a set of axes pre-placed. I'm using the location property of the legend to place it to the right hand side of the axes. However, by doing this the axes get re-scaled so that the axes+legend take up the original width of the axes. Is there any way to circumvent the re-size? Example: x=0:.1:10; y=sin(x); fi...

MATLAB: inconsistent results using isreal

Take this simple example: a = [1 2i]; x = zeros(1,length(a)); for n=1:length(a) x(n) = isreal(a(n)); end In an attempt to vectorize the code, I tried: y = arrayfun(@isreal,a); But the results are not the same: x = 1 0 y = 0 0 What am I doing wrong? ...

Does anyone know how to plot a dome (aka half sphere) in MATLAB...or anyother programming language?

I need to plot a dome or half a sphere and be able to change the dimensions of the dome. I figured MATLAB would be my best choice. any suggestions? THanks ...

Good practices in writing code?

I am an engineering student, not computer science though, and have been coding in Matlab for like 4 years. However only recently I have experienced writing long codes, or the need for connection of some multiple codes and data. Writing the code in bits as general functions is one of the things I have experienced lately is a good thing to...

Solve for only certain variables with symbolic solver

I am trying to solve a system of equations in MATLAB with 3 variables and 5 constants. Is it possible to solve for the three variables with solve while keeping the constants as symbolic and not replacing them with numerical values? ...

end matlab process

Is there a way to end a matlab process that is taking too long to run? ctrl+alt+delete is all I know right now and that shuts downt he program entirely. ...

has fsolve been replaced in MATLAB 2010a?

I just upgraded to MATLAB 2010a. It seems that fsolve no longer works. Has this been replaced? ...