Answered

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

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

9 years ago | 0

| accepted

Answered

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.

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.

9 years ago | 0

Answered

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')

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')

9 years ago | 0

Answered

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

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

9 years ago | 0

Answered

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

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

9 years ago | 0

Answered

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

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

9 years ago | 0

Answered

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

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

9 years ago | 0

Answered

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

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

9 years ago | 0

Answered

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

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

9 years ago | 0

Answered

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

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

9 years ago | 0

Answered

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

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

9 years ago | 0

| accepted

Answered

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

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

9 years ago | 0

Answered

code for integral function

The common way to do this will be like: syms r d y; f= (r^(r+d))*( d^2 * y^2)/( (d+r)^2*d^3 ) F = int(f, y) % Calcu...

code for integral function

The common way to do this will be like: syms r d y; f= (r^(r+d))*( d^2 * y^2)/( (d+r)^2*d^3 ) F = int(f, y) % Calcu...

9 years ago | 0

Answered

How can I generate text file in loop?

You sould open the file with the 'append' modificator. fid= fopen(filename, 'a') % Use fprintf (for example) to print the ...

How can I generate text file in loop?

You sould open the file with the 'append' modificator. fid= fopen(filename, 'a') % Use fprintf (for example) to print the ...

9 years ago | 0

| accepted