Answered
How to apply custom equation on a curve and find unknown parameter
If you have Statistics Toolbox, use <http://www.mathworks.com/help/toolbox/stats/nlinfit.html |nlinfit|>. f = @(b,x) 3.379 ...

15 years ago | 0

Answered
Passing array to a function
What Teja said. I hate to ask the dumb question, but do you actually want to do indexing on line 71? Many people write thing...

15 years ago | 0

Answered
Please help me creating help button please!!
Make a pushbutton uicontrol (or menu item) and give it a callback that creates a new figure window. This figure has a static te...

15 years ago | 0

Answered
how do I modify the axis in plot(x,y)?
So you want the x-axis to be nonlinear (but not necessarily log)? Well, you can always cheat. Do what Matt Fig suggests, but c...

15 years ago | 1

| accepted

Answered
Memory issues in using xlsread and dataset('XLSFile'...)
Do you have a simple way to write the file out in a different format (eg text, such as CSV)? What are the columns of your file?...

15 years ago | 0

Answered
Choice of data structure - cellarray or dataset
In addition to what Oleg suggested, does "code" store a small number of possible values, or are they all distinct (for 1.5 milli...

15 years ago | 1

Answered
nonlinear regression
I'm not getting the problem you are. I get a warning (see below), but then slightly different coefficients and a very good matc...

15 years ago | 0

Answered
how to clear the warning negative data ignored?
Use |lastwarn| to find the identifier of the warning message, then use |warning| to turn it off. Once you know the identifier, ...

15 years ago | 0

Answered
Please help me on this problem!! I need help with uitable!!!
H = mat2cell([H1;H2]); (vertical concatenation, not horizontal)

15 years ago | 0

| accepted

Answered
run through a cell content in single loop
Do you want |AA| to be a cell array or whatever type the contents are (assuming they're all the same)? In the former case |AA =...

15 years ago | 0

| accepted

Answered
About null values
It sounds like this is a delimited text file, in which case I'd recommend using |textscan|. It will use |NaN| in place of missi...

15 years ago | 1

Answered
Plotting graphs from different m-files
hold on Just make sure that your scripts don't clear any figures when they run.

15 years ago | 0

| accepted

Answered
Profiler Paradox
Profiler isn't really the right tool for (absolute) timing a chunk of code - as has been noted, it adds overhead, plus you have ...

15 years ago | 0

Answered
Use while loops for a function to keep asking for inputs, until an invalid input is entered
Your logic is fine. The problem is with your use of |y(x)|. MATLAB is a computational, not symbolic, language - |y| is a varia...

15 years ago | 0

| accepted

Answered
Finding indices in matrix with find() function
I think you may have fallen for an old trap. Please enter 1 - LUTj(60,240) and see what the result is. I'm going to ta...

15 years ago | 0

Answered
how to generate numbers randomly
If you want indices, use |randi| to generate integers from 1 to |n| idx = randi(length(x),7,1) random7 = x(idx) This sampl...

15 years ago | 0

Answered
isempty
Problem seems to have been resolved (see above comments), but for the record: isempty(x) Another possibility would be ...

15 years ago | 0

| accepted

Answered
Resort struct elements by one field values
Would this do it? a.foo = [3, 4, 1, 2, 5]; a.bar = {'a','b','c','d','e'}; % assuming b already exists b = a; % ...

15 years ago | 0

| accepted

Answered
System of ODE
You already have the code: |dy = A*y|. Given how simple it is, you don't even need to write a function file -- you could just u...

15 years ago | 1

Answered
Basic ODE question
# Write a function that defines the rate equations. The system should now look like z' = f(c,z), where z = [A;v]. Write your f...

15 years ago | 0

| accepted

Answered
Trying to create a filled colour contour plot. Specifically in the form of a depth profile.
For an older version of MATLAB (without |TriScatterdInterp|): x = rand(100,1)*4-2; y = rand(100,1)*4-2; z = x.*exp(-x...

15 years ago | 0

| accepted

Answered
fsolve problem
Given that |airProp2| doesn't appear to modify |T|, my guess is the problem is with the value you're passing in, which is |Th_ou...

15 years ago | 0

Answered
How can I tell a set of data is normally distributed?
normplot(x) And for formal tests, see |lillietest| and |jbtest| (NB: these are all Statistics Toolbox functions. If you're ...

15 years ago | 6

| accepted

Answered
reconstructing image that has been decompposed using svd
What do you mean by "the inverse of SVD"? The SVD is a decomposition: |A = U*S*V'| so reconstructing |A| just requires performi...

15 years ago | 1

| accepted

Answered
MATLAB one-liners
Inspired by something I'm working on right now & your comment to my previous answer... If you have an n-by-1 structure array ...

15 years ago | 1

Answered
Taking the derivative of an Action Potential to find the inflection point
Approximate derivative of a discrete signal y (with discrete independent variable t) can be obtained using dy = diff(y)./diff...

15 years ago | 0

Answered
MATLAB one-liners
I'm a huge fan of logical indexing. Expressions like mean(frogs(wombats > 42)) rock my world.

15 years ago | 1

Answered
Testing for identical numbers in matrix columns
all(~diff(A)) Like Andrew's idea, but a bit neater(?). The not (~) converts the differences to logicals (0 difference -> tru...

15 years ago | 6

| accepted

Answered
Trying to create a filled colour contour plot. Specifically in the form of a depth profile.
Something like this, perhaps: % invent some x,y,z data x = rand(100,1)*4-2; y = rand(100,1)*4-2; z = x.*exp(-x.^2-...

15 years ago | 1

Answered
How can I find saturated pixels in an image?
|idx = all(A==255,3);| would give you a logical array that is |true| at all white pixels (in a |uint8| representation). Other...

15 years ago | 2

Load more