matlab

Using errorbar() with semilogy() in MATLAB?

I'd like to plot data x & y with errorbars, ebar, and its fit, yfitted, on a semilog plot. This doesn't seem to work: figure; hold on; errorbar(x,y,ebar); semilogy(x,yfitted); Instead of semilog plot I get a linear plot. What should I be doing differently? ...

Making outputs from an array in Matlab?

I have an array of 20 items long and I would like to make them an output so I can input it into another program. pos = [0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,] I would like to use this as inputs for another program function [lowest1, lowest2, highest1, highest2, pos(1), pos(2),... pos(20)] ...

How can I implicitly solve a single equation in Matlab?

The following equation is to be solved for M by MATLAB: (Atemp/At)^2=1/M^2*((2/(gamma+1))*(1+(gamma-1)*M^2/2))^((gamma+1)/(gamma-1)) It is not possible to solve this equation symbolically. In Maple it is easily possible to solve such an equation implicitly; now, is there also a pre-made function in Matlab that does this for me? I coul...

what does MajorAxisLength property in regionprop matlab function mean?

I am using regionprop function in matlab to get MajorAxisLength of an image. I think logically this number should not be greater than sqrt(a^2+b^2) in wich a abd b are the width and heigth of the image. but for my image it is. My black and white image contains a black circle in the center of the image. I think this is strange. Can anybod...

How to read data in chunks from notepad file in Matlab?

My data is in following format: TABLE NUMBER 1 FILE: ReservoirModel_CMGBuilder.irf WELL: Well-1 TIME Oil Rate SC - Yearly day bbl/day -0.01 0 364.99 35368.4 729.99 29307 1094.99 27309.5 1460.99 26058.8 1825.99...

i want a X-OR code for neural network in matlab

i m doing project on neural network. i want a demo code for AND,OR,X-OR or any SMALL APPLICATION in matlab. thanks ...

Matlab - Out Of Memory Error

I have a problem which occurs when I write the command line of the rbf (radial basis function) neural network net = newrb(T, D); I get the error **??? Error using ==> unknown Out of memory. Type HELP MEMORY for your options. Error in ==> dist>apply at 119 z = zeros(S,Q); Error in ==> boiler_weight at 38 result = apply(a,b,c); Err...

Why for my case Matlab 64 bit is longer?

To increase the timeliness of my programs matlab, I got Windows 7 (64bit) and 64bit Matlab. and I've installed on a partition of the hard disk. Unfortunately, I was shocked to see that the execution time of the program is longer with 64bit Matlab. I do not know what's the problem. knowing that I have a core 2 Quad processor and 3GB of RA...

Force matlab gui to update ui control mid-function

I'm working on a gui using GUIDE in MATLAB, and from what I've read it looks like MATLAB updates the UI controls based on a timer every so often. Is there a way to force it to update the UI controls, so I can make it update in the middle of the function? Right now I have a function that does, simplifed, something like set(handles.lblSta...

Is it possible to define more than one function per file in MATLAB?

When I was studying for my undergraduate degree in EE, MATLAB required each function to be defined in its own file, even if it was a one-liner. I'm studying for a graduate degree now, and I have to write a project in MATLAB. Is this still a requirement for newer versions of MATLAB? If it is possible to put more than one function in a f...

How can I get a waitbar to work in Matlab?

I want to have a waitbar for an operation that takes quite a while. Here is my code: h = waitbar(0,'Please wait...'); for i=1:counterend waitbar(i/waitbarcounter) Atemp = At+i*step; handle = @(M) 1/M^2*((2/(gamma+1))*(1+(gamma-1)*M^2/2))^((gamma+1)/(gamma-1))-(Atemp/At)^2; Mach = fzero(handle, 5); Aplot(i) ...

Determine distance from coastline in Matlab

In MATLAB, I have an array of latitude and longitude pairs that represents locations in the United States. I need to determine the distance to the nearest coastline. I think MATLAB has a built in database of lat/lon points of the United States. How do I access it and use it? Also any suggestions on how to efficiently determine the di...

MATLAB: sorting rows of two matrices using same ordering

Possible Duplicate: Sort a matrix with another matrix Given two matrices A and B of the same size, I want to sort A across the second dimension (rows) and apply the same ordering to the matrix B. Is it possible to vectorize this current code? r = 10; c = 4; A = rand(r,c); B = reshape(1:r*c,c,r)'; % can be any random matrix' ...

How can I convert between RGB565 and RGB24 image formats in MATLAB?

I am getting an RGB matrix from a microprocessor that outputs an image in RGB565 format. I want to read this into MATLAB, convert it to RGB24 format, and output the image. How do I do this? ...

fsolve anonymous function with two inputs

I have the following function: Eq = @(x1, x2) [x1-6, x2+3]; fsolve(Eq, [4 1]) but get the following error: ??? Input argument "x2" is undefined. Error in ==> @(x1,x2)[x1-6,x2+3] Error in ==> fsolve at 193 fuser = feval(funfcn{3},x,varargin{:}); Error in ==> Untitled at 6 fsolve(Eq, [4, 1]) It works perfectly when I change t...

fsolve with solution bounds

Is there a way to use fsolve in MATLAB, specifying a bound for the solution? i.e. all solution variables > 0 ...

Matlab : Creating an array of a single value

Hey, I'm using matlab and want to check whether a column vector is equal to another withing 3dp, to do this i'm trying to create an array full of 0.001 and checking whether it is greater than or equal. is there a simpler way than a for loop to create this array or no? if more info is needed just ask, i'm not very good at this. Cheer...

what function or loop do I have to use to average the matrix?

Hey I want to find the average of all the matrix: Data=(Data{1}+......+Data{n})/n) where Data{n} is a matrix of m*n.. Thank you sooo much ...

acquire data from text files in matlab

Hello everyone. I have a big problem to Acquire a block of data structured in a particular way. Here's how the data are to be acquired (is a txt): V|0|0|0|t|0|1|1|4|11|T4|H13|||||||||||| P|40|0.01|10|1|1|0|40|1|1|1||1|*||0|0|0 *|A1|A1|A7|A16|F|F|F|F|F|F||||||||||||| *|codserv|area|codice|nome|tnom|tmin|tmax|pc|qc|susc...

Suppress exponential formatting in figure ticks

Tick labels for ticks bigger than about 10'000, get formatted to 1x10^4 for example. Whereas the exponential part appears above the corresponding axes. This misbehavior has been well described on on matlab central as well, but without a solution. Thanks for your help. The 'quick trick' set(gca, 'YTickLabel',get(gca,'YTick')) did...