Calculate the area between two curves
f =@(x) sin(3.*x+1) ; g=@(x) exp(abs(x)/2 -2)-1; a=3; b=6; x=linspace(a,b,73); S=0; for k=1:length(x)-1 S=S+abs( ...

oltre 5 anni ago | 0

| accepted

How can I know if MATLAB is using 64 bit double precision?
Actually, I don't know if that changes how the computations are made, or how the results are shown.

oltre 5 anni ago | 0

How can I know if MATLAB is using 64 bit double precision?
If you want all numeric results appear in 64 bits, you have to use: float('double') float('long')

oltre 5 anni ago | 0

How to write part of a structure to an output file (.txt)?
Take this as an example: x={'1', '2', '3'} fileName='test.txt' fid=fopen(fileName, 'w') for k=1:length(x) fprintf...

oltre 5 anni ago | 0

Help finding error in gauss seidel method
I think it has to fail int the 'while' loop: you dont have a prior value for the variable 'errorx', so it will probably will say...

oltre 5 anni ago | 0

How to use data in a structure
If all your data is inside the structure A, you should call data and txt like this: B=A.data C=A.txt

oltre 5 anni ago | 0

Solving a non linear differential equation
syms f(t) ; S = dsolve(diff(diff(f)) == ( (12.12*sin(417*t)+0.065)-((18043*(cos(417*t)-sin(417*t)))+110))*f + 431*sin(417*t...

oltre 5 anni ago | 0

solving systems of differential equations
I give you an example to solve a system of 2 differential equations: syms f(t) g(t) % one for every function S = dsolve(...

oltre 5 anni ago | 0

Parsing a text file by character
If there are several lines, you can extract them using this: fid=fopen(fileName) B = textscan(fid, '%f %f %f', 'Delimiter'...

oltre 5 anni ago | 0

Using fscanf to read in data
You are right dpb, i think textscan is better in this case; the next code extract 3 columns according to the format described: ...

oltre 5 anni ago | 0

??? Error using ==> plot Conversion to double from sym is not possible...help?
ItÂ´s not clear what you are trying to do, but there are some bad things here: 1) when you use int command, you dont give the ...

oltre 5 anni ago | 0

| accepted

How to find the element in on boundary or interior?
If you suppose there is only one value 2 in the matrix, this code may be useful: a=[3 4 5;6 2 1; 1 6 9] % interior value ...

oltre 5 anni ago | 0