Respondida
For loop execution problem in matlab
A = zeros(1,10); for ii = 1:20 if i<=length(A) A(ii) = 1; elseif i>length(A) ...

más de 11 años hace | 0

| aceptada

Respondida
How do you evaluate a function over a range of more than one variable? Rate-Time Decline Curve Analysis
t=0:14600; b = 1:0.1:2; [T B] = ndgrid(t,b); Now you can evaluate your function for all values of T and B. You ca...

más de 11 años hace | 0

| aceptada

Respondida
Problem to save a variable to a .mat file
The error message is descriptive. Please try: save(filename,variables,'-v7.3') Please read the documentation if you would...

más de 11 años hace | 1

Respondida
I have the ideal point (500,700) and the calculated point (499.79,700.44). I want to calculate the error but i can't. Please help me out
absolute_error = mean(abs((observed(:) - simulated(:)) ./ observed(:)) .* 100)

más de 11 años hace | 0

Respondida
compute event rate and plot histogram
If your want to get Matlab serial date number and you don't care about leap seconds, then you could do: tun=int64([138855713...

más de 11 años hace | 1

Respondida
How can I read NetCDF file data in Matlab?
doc netcdf All the capacities are well explained in the documentation. You could start reading that.

más de 11 años hace | 0

| aceptada

Respondida
how to load my library in to matlab???
Include it in the program. Type _your_function_name_ where you want it to load.

más de 11 años hace | 0

Respondida
Convert from Microsoft's DateTime Structure to readable date
No, I don't think there is. But if you don't care about leap seconds it is not too complicated: epoch = datenum(1,1,0); ...

más de 11 años hace | 1

| aceptada

Respondida
Sequence of adding numbers
It might better if you put all your results in one array. Perhaps like this: ii = 1:4; C = NaN*ones(size(ii)); for id...

más de 11 años hace | 1

Respondida
How to eliminate "Edit Plot" arrow error in a copied figure?
When you do _allchild(figList(iOld))_, you are copying *everything*. That includes the uicontrols and menu. That is the source o...

más de 11 años hace | 0

| aceptada

Respondida
How do I create a pair of matrices approximating a convex hull of a set of points in 2-space?
*Assuming linear mapping*: Not the most efficient thing out there, but it serves as a proof of concept. The important thing ...

más de 11 años hace | 0

Respondida
How do I extract subscript numbers from a matrix element?
[row,col] = find(V); plot(row,col,'r+');

más de 11 años hace | 0

| aceptada

Respondida
Using find function output locations to sum over values from another matrix.
idx = M(:,:,1) == 1; s1 = sum(sum(M(:,:,2).*idx)); s2 = sum(sum(M(:,:,3).*idx));

más de 11 años hace | 0

| aceptada

Respondida
What do the (automatically assigned) colors in a Histogram stand for?
If you do _hist()_ on a 2D array, then you will get an histogram for each column of your array. The bars with the same color wi...

más de 11 años hace | 0

| aceptada

Respondida
read specific files in a directory
Ok, I'll get you started: %Finding all .vtk files in directory your_vtk_files = dir; your_vtk_files = {your_vtk_files(:)...

más de 11 años hace | 1

Respondida
Can figure numbers be re-assigned?
To get a list of all the existing figures: get(0,'Children'); If figure two does not exist and you want to copy figure(5...

más de 11 años hace | 2

| aceptada

Respondida
how to resize my large vector to a smaller one for plotting?
doc resample

más de 11 años hace | 0

Respondida
change display name of a data
You could modify only the text, but that is bound to wreak havok on the display: plot(rand(10,5)); l_str = {'A','B','C','D...

más de 11 años hace | 0

Respondida
How can I know the the size of an inline or anonymous vectorial expression?
nargin(F) Please accept an answer if it helped you.

más de 11 años hace | 1

| aceptada

Respondida
100 times loop execution
for ii = 1:100 name = ['result_' num2str(ii) '.mat']; multiuser_traffic; %run script save(name); end ...

más de 11 años hace | 0

| aceptada

Respondida
how to set multiple fields in a struct without using a loop
A = {'A1';'A2';'A3'}; your_struct = cell2struct(repmat({[]},3,1),A); Please accept an answer if it helped you.

más de 11 años hace | 0

| aceptada

Respondida
Write both strings and numbers to a file?
Yes you can: s = 'I am a string'; n = pi(); fprintf(1,'%s %f',s,n); %Replace 1 with an actual fid

más de 11 años hace | 0

| aceptada

Respondida
Doubt regarding the fzero command.
It means that the function _estimateSurfacePressure()_ is in the path and will be evaluated for different values of _PO_ until o...

más de 11 años hace | 0

| aceptada

Respondida
How to find local peaks of plot? How to smooth data?
Then look in the file exchange: <http://www.mathworks.com/matlabcentral/fileexchange/11755-peak-finding-and-measurement For e...

más de 11 años hace | 0

Respondida
Find duplicate entries and average associated values
array = [1 10; 2 20; 3 30; 4 40; 4 50; 4 60; 5 70; 6 80; 7 90; 7 100; 8 110]; [C,ia,idx] = unique(array(:,1),'stable'); va...

más de 11 años hace | 6

| aceptada

Respondida
Is there a Matlab code for the probit random effects model for panel data?
That sounds like a specialized statistical tool. I'd be surprised if it is a native Matlab function. You could always try the...

más de 11 años hace | 0

| aceptada

Respondida
Lloydsalgorithm: Color value must be a 3 element numeric vector
pathHandle(i) = plot(Px(i),Py(i),'-','color',cellColors(:,i)*.8);* Should be pathHandle(i) = plot(Px(i),Py(i),'-','co...

más de 11 años hace | 0

| aceptada

Respondida
Variable size changes on every iteration
Pre-allocate. Before _departure(1) = 250_, place: departure_time = NaN .* ones(30,1);

más de 11 años hace | 0

| aceptada

Respondida
Specifying elements of a structure array that have different fields
To get a logical index into all _'human'_: humanIdx = cellfun(@(x) strcmp('human',x),{particle(:).type}) Please accept an...

más de 11 años hace | 0

Respondida
Split one array into two while splitting each cell
*Building from Cedric's answer* Then your data probably looks like this: data = [{'13008KT}'}, {'08009KT'}, {'13009K...

más de 11 años hace | 0

Cargar más