已回答
I want to seperate the data 02/12/99Z using textscan. Can you please help me?.
I usually read each line as a string, giving me a cell array of lines. I then parse each line using sscanf. In your case: ...

7 years 前 | 0

已回答
How to solve nonlinear problem of magnetic bearing shaft system ?
Your code will not work in an ODE solver because you reset the input value x on line 2. Get rid of that and make sure all lines...

7 years 前 | 0

已回答
I am using fsolve and receiving errors
It seems that you try to solve an overdetermined system. You have six equations in five unknowns. You should re-examine your pr...

7 years 前 | 0

已回答
Scan through a txt-file and find certain strings and replace certain lines by replacing strings
fid = fopen('in.txt'); lines = textscan(fid,'%s','delimiter','\n'); fclose(fid); lines = lines{1}; relevant = f...

7 years 前 | 1

已回答
Why is my fprintf value doesent come out as I wanted?
Try fprintf('%-4.0f | %f | %f | %f | %f | %f | \n ',ReT(i),FCT(i,1:5))

7 years 前 | 0

已回答
How to get index of each points in data?
>> [~,ix] = sort(A(:,4)) ix = 2 1 4 3 >> sort_A = A(ix,:) sort_A = 999 999 ...

7 years 前 | 1

已回答
How can I calculate the area of latitude and longitude?
areaint from the Mapping Toolbox should do the trick. It you do not have access to that toolbox you could use polyarea, afte...

7 years 前 | 0

已回答
Closest value in an array, and how to correctly look it up afterwards
It is not entirely clear to me what you are trying to do. My best guess is that, for each element y(l) , you want to find the el...

7 years 前 | 1

| 已接受

已回答
How do i find the integral of a function
X = @(t) a1+k1*sin(w1*t)+(a2+k2*sin(w2*t)+ 1/(2*pi*sd)*exp(-(t-mu).^2/(2*sd^2)); t = linspace(0,30);plot(t,X(t)) plot(t,...

7 years 前 | 1

| 已接受

已回答
How do I integrate properly on matlab? My answer always ends up being 0.
We are normally restrictive when it comes to homework help, but it seems that your algorithm is OK and your problems are purely ...

7 years 前 | 0

| 已接受

已回答
How do I fit a PDF to a histogram?
If you have access to the curve fitting toolbox (I don't) you can probably use fit. If not, the following example illustrates ho...

7 years 前 | 0

已回答
for matlab 2013 is there a function that compares between three values within tolerance?
There is no such function. The following somewhat involved construct will do the trick: x = [.2 .15 0.3]; tol = 0.05+1...

7 years 前 | 0

已回答
i need help on what is wrong in these codes for performing loop
First, your code is hard to read and needs extensive editing if I copy it to the Matlab editor. Add a blank line before the cod...

7 years 前 | 0

已回答
Curve Fitting LogLog Plot
You should curve fit the logarithms: x = [ 0.5000 1.0000 2.0000 5.0000 10.0000 20.0000 50.0000 100.0000]; y = [ 0.8447 1.4...

7 years 前 | 8

已回答
how can i find row position for minimum value that changes every cycle. each cycle has 100 data points( 100*1 matrix).
You could arrange your 6000 data cycles in a 100 by 6000 matrix and use the min function. Example, using only 10 cycles: X ...

7 years 前 | 0

已回答
Below I have stated both my 'original code' and its corresponding 'vectorized code' for the series approximation of Error function, but I'm getting wrong results by evaluating my 'vectorized code'. Please help.
The best way to debug a program with large arrays is to reduce the size of the problem so that arrays are small enough to easily...

7 years 前 | 0

已回答
How to fill the area between a group of lines
You need to stack your x and y arrays into new arrays so that they form the circumference of the area in a consistent direction ...

7 years 前 | 0

已回答
Index exceeds matrix dimensions.
It appears that one of your arrays has too few elements. On the editor toolstrip, select Breakpoints -> Stop on errors ...

7 years 前 | 0

已回答
how to save cell array which not have equal row in each column to .csv
function cell2csv(c,filename) % Writes a cell array of 1D arrays to a csv file c = c(:); fid = fopen(filename...

7 years 前 | 0

已回答
How to curve fit a transcendental function to data?
Set k0 = [k1_0;k2_0;k3_0] to a vector of initial values for your unknown parameters. Write your function as: predic...

7 years 前 | 1

| 已接受

已回答
problem with Matrix Multiplication
Note that in Matlab, vectors are matrices of column or row shape and. A 2 by 2 matrix can only be multiplied by a column vector...

7 years 前 | 0

已回答
Problem with fmincon: nonlcon
To transfer the extra inputs to DiagCAW11_constraints you should use an anonymous function: Make sure that RC, r, bsum are de...

8 years 前 | 0

已回答
cumsum function for seperate time
Interesting problem. Here is one possible solution: dates = {'01/01/1975'; '05/01/1975'; '25/01/1975'; '05/02/1975';... ...

8 years 前 | 0

已回答
How to replace a variable or function with another variable or function ?
You could define an anonymous function f(x): f = @(x) x.*(x.^2-1); Note the '.' before the * and ^operators. This lets t...

8 years 前 | 2

已回答
How to reset variables before each iteration
Here is an example that clears all variables except b and c: % Fist create some variables a = 1; b = 2; c = 3; d = 4; ...

8 years 前 | 0

已回答
How do I read only specific columns in from an Excel file, not consecutive columns?
I enclose a first version of a function I just wrote. This will read a number of columns from a large Excel file. Since it ope...

8 years 前 | 1

| 已接受

已回答
How to seperate fractional and decimal part in a real number
mod(number,1)

8 years 前 | 0

已回答
What kind of solver should I use for a non-continuous function?
Note that the function that you give to ode45 returns the velocity and acceleration. When you change the sign of v in this func...

8 years 前 | 0

| 已接受

已回答
Consider a loop of string with unit length. Take n cuts independently and randomly along the string, what is the expected length of the smallest and the largest piece?
Your question is not very clear. The code below is an answer to: How can I code a test of this result? N=100000; % Number ...

8 years 前 | 1

已回答
solve a system of ODE
function [t,x]=euleroesplicito(fcn,t0,x0,h,tend) n = fix((tend-t0)/h)+1; t = linspace(t0,t0+(n-1)*h,n); x = ze...

8 years 前 | 1

| 已接受

加载更多