Answered
How can I integrate an equation with using trapezoidal rule?
This pretty clearly would be a homework type problem, so a) what have you tried so far, and b) what part of doc trapz % see...

11 years ago | 0

Answered
Find sum of matrices, of different sizes, in a cell
s=sum(cellfun(@sum,C)); *ADDENDUM* For more than 1D cells, *sum* returns sums by column instead of single total sum. Use ...

11 years ago | 1

Answered
How can I create a plot with quaterly dates on the x-axis ?
dn=datenum(1973,1+[0:3:12*(2013-1973)].',1); % make a sample time vector [datestr(dn(1)) '<->' datestr(dn(end))] % s...

11 years ago | 0

| accepted

Answered
Read Multiple lines of Mixed Data from DAT file
Sequential files are, well, "sequential". There's not a way to read them as random-access; best one can do(*) is to read record...

11 years ago | 0

Answered
how to output logical arrays in each cell element of the cell array using ismember function???
Use *cellfun* to apply functions to each cell or comparably-sized cell arrays-- >> cellfun(@ismember,A,B,'uni',0) ans = ...

11 years ago | 0

| accepted

Answered
Matrix A to B
>> [i j]=ind2sub(size(A),find(iswithin(A,1,100))); >> [i j] ans = 1 3 1 4 2 4 1 5 ...

11 years ago | 1

| accepted

Answered
help me with dots location
Everywhere there's an arithmetic operator (other than *+* or *-* which are born doing the right thing :) ) replace the operator ...

11 years ago | 1

Answered
Remove Decimal part from number
doc mod >> mod(9588,256) ans = 116 >>

11 years ago | 1

| accepted

Answered
reading a text file by correct date format
OK, as I suspected, the file format is _NOT_ tab delimited but fixed-width columns _except_ the records aren't the same length; ...

11 years ago | 0

| accepted

Answered
how to use if when there is NAN
Yeah, compute the means first and then do the comparison over the valid regions. You can augment sizes later however you so cho...

11 years ago | 0

Answered
How to plot a line graph with algebraic function
Try ezplot('-3.546*x^4 + 40.652*x^3 - 172.24*x^2 + 320.58*x - 221.62') % let if default ezplot('-3.546*x^4 + 40.652*x^3...

11 years ago | 0

Answered
How to reference multiple matrices in cell arrays using a colon or other special characters rather than a loop?
That's what *cellfun* is for... >> a={rand(2)}; a(2)=a(1); % a simple test >> b=a; >> cellfun(@rdivide,a,b,'uni',0) a...

11 years ago | 0

| accepted

Answered
how to create 2D polynomial regression?
If have CurveFitting Toolbox, sf = fit([x, y], z, 'poly22'); % doc fit for details... If not, write the specific model ...

11 years ago | 0

| accepted

Answered
Changing the current axes causes a line that is a child on another axes to disappear.
When you create the second axes, use _'Color','none'_ to make the first axes also visible. See the example of <http://www.mathw...

11 years ago | 0

Answered
Index out of bounds using "length"
WAD. length Length of vector. length(X) returns the length of vector X. It is equivalent to MAX(SIZE(X)) for ...

11 years ago | 0

Answered
Several statements in if condition plotting and drawing arrow
_"...But when I use this code it shows just last nt value in if condition (1001) in the title."_ Surely. Because (quoting fr...

11 years ago | 0

| accepted

Answered
adding same size cell arrays
cellfun(@plus,A,B,'uni',0) cell2mat(A)+cell2mat(B)

11 years ago | 1

| accepted

Answered
How can I compile the values of a variable based on the value of a second variable?
Using _a_ and _e_ for the two arrays, respectively, >> ix=interp1(a,[1:length(a)].',e,'nearest','extrap') ix = 1 ...

11 years ago | 0

Answered
Finding a character in a string in an array of cells
>> G = {'1010101', '0010101', '0010101'}; >> G{1}(1) ans = 1 >> doc cell % for details on addressing NB: however...

11 years ago | 0

| accepted

Answered
How to move set of points diagonally ?
Add the offset to both (or all 3) coordinates... x(i+di;j+dj,k+dk)=x(i,j,k)

11 years ago | 0

| accepted

Answered
While loop with multiple conditions
while (resolution_check<8) & (mX_check>0.1) & (Nx<5000) .... Not sure why you left the second conditional off but that...

11 years ago | 0

Answered
How to process text file line by line
doc fgetl >> fid=fopen('fatem.dat'); >> while ~feof(fid) x=sscanf(fgetl(fid),'%f'); % insert desired p...

11 years ago | 0

Answered
Second y axis for the same dataset
OK as follow-up to my above comment -- try the following with some of your real data and let us know how it succeeds...w/o a rea...

11 years ago | 0

Answered
Second y axis for the same dataset
Alternative to display overlapping data succinctly... for i=1:2, hAx(i)=subplot(1,2,i); end % create base left/right...

11 years ago | 0

Answered
TXT Data Extraction Help
OK, had a little time to explore the data enough to figure out what appears to be going on...a simplistic way since there turns ...

11 years ago | 0

| accepted

Answered
pause a running executable and continue other calculations in Matlab
You'll have to implement some sort of nonblocking semaphore into the Fortran code to allow it to release the CPU and then have a...

11 years ago | 0

| accepted

Answered
Link data with datenum
Alternatively to Per's solution via interpolation, if you want to aggregate data as you've mentioned and average over the time p...

11 years ago | 0

Answered
How to set the position of x/y-ticklabel closer/further away from the axis
Not by anything other than writing your own labels where you want them via *text*, no. You could change appearance somewhat wit...

11 years ago | 0

| accepted

Answered
How to assign A or B or C to a Variable?
You do _*NOT*_ want to do this...for why and alternatives, see the FAQ <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variab...

11 years ago | 1

Answered
Is it possible to label (the last) minor tick?
Just an editorial aside -- they're 'major', not 'mayor' ticks... But, the answer to the question is "no can do" -- there's no...

11 years ago | 0

| accepted

Load more