回答済み 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( ...
回答済み 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...
10年以上 前 | 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
10年以上 前 | 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...
10年以上 前 | 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(...
10年以上 前 | 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'...
10年以上 前 | 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:
...
回答済み 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...
10年以上 前 | 0
回答済み 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 ...