Answered
How to multiply a vector with each column of a matrix most efficiently?
The first question has been addressed, so I'll just throw out a couple of points about the second question. * The newer the v...

15 years ago | 2

| accepted

Answered
Throws to get yatzy?
Try this: function [nr_throws] = nr_throws() nr_throws=1; % First throw throw = randi(6,1,5); most_common=mode...

15 years ago | 0

| accepted

Answered
Ordering answers to calculations with lowest first
results = zeros(16,1); for k = 1:16 results(k) = %do calculation end disp(sort(results)) Is that what you mean? ...

15 years ago | 0

Answered
solving system of ODE's
Although I'd generally agree with Jarrod about using |ode45| or similar, from the wording of the question, it sounds like your p...

15 years ago | 0

Answered
Datenum failed
Assuming you haven't looked at every string individually, I'd guess the mostly likely cause is a malformed string somewhere in t...

15 years ago | 0

| accepted

Answered
matlab certification
RoJo is correct. You receive confirmation of any MathWorks training courses you complete, but there is currently no MathWorks...

15 years ago | 3

Answered
TUTORIAL: how to ask a question (on Answers) and get a fast answer
Do (if possible): * Give examples. * Provide standalone code. If not possible, give a thorough explanation of what the miss...

15 years ago | 7

Answered
i need to read matrix from a png file
*answer* (1) Yes, a |for| loop will do the job. You need a string in each pass through the loop to represent the file name. Yo...

15 years ago | 1

Answered
altering matrices
convn(A,B,'same') where |A| is your matrix, and |B| is a mask that determines the weightings of points for averaging. ...

15 years ago | 2

| accepted

Answered
Find the Error - FZero Function. Constant loop.
You're calling |fminsearch| with the same initial guess every time. So you get the same |NCons| and |NFirm| every time. So you...

15 years ago | 0

Answered
Sorting Algorithm
In the spirit of Sean's answer... this works for the given example: [~,idx] = unique(Array1); Array2(idx) *EDIT* (and may ...

15 years ago | 0

Answered
Hello , by matlab , compute the product of :
disp(1*0.6366)

15 years ago | 1

Answered
Contributors metainfo: reputation and more
Various congratulations are in order. # Walter's 1500th answer # Walter breaking 2500 rep # Matt Fig's 500th answer # Paul...

15 years ago | 1

Answered
finding coordinates or locations in matrix?
[row,col] = find(...)

15 years ago | 4

| accepted

Answered
'fname' variable or function?
This is a common error when someone runs a function as a script. That is, running Rebuild2 via the interface (the Editor "play ...

15 years ago | 0

Answered
Get Unique Instance Identifier
Dumb question: why can't you just use the cell index?

15 years ago | 0

Answered
Insert zeros in a vector - Random
Perhaps I misunderstand, but you should be able to do simply: spikes(SpikeTimes*10) = 1; Example: x = [1 2 7 14 17] y =...

15 years ago | 0

| accepted

Answered
PCA matrix indexed by Day
How are the matrices stored? Chances are, this is probably time for an old-fashioned |for|-loop, possibly using 3-D arrays.

15 years ago | 0

Answered
Problem of robust fitting using the "robustfit" function
There really is no "right" answer, because it's a matter of how you view the problem. |robustfit| uses the residuals to calcula...

15 years ago | 0

Answered
Pearson Calculation using MATLAB
Your |y| values are all the same. Hence y_i - mean(y) = 0 for each i. The formula for covariance is cov(x,y) = sum_i[(x_i-m...

15 years ago | 0

Answered
Data Return Using @
|t| is not determining the parameters |mu|, |sig|, and |df|. They are arguments to the function defined by |t|; they are passed...

15 years ago | 0

Answered
Calculating Mean inside a loop
If you have Statistics Toolbox, you can use |grpstats|. In general, if you're doing a lot with variables in groups, you might w...

15 years ago | 0

| accepted

Answered
variable coefficient
All the solvers can handle variable coefficients - they are completely ignorant of the details of the equations. All they requi...

15 years ago | 0

| accepted

Answered
please help me to rewrite this code correct
A few problems leap out at me right away: # |x1 = x0 - f\diff(f)| Slashes in MATLAB are interpreted as "solve the system of eq...

15 years ago | 0

Answered
Changing grid lines to a solid line instead of dashed
set(gca,'GridLineStyle','-') You can't change the gridline color independently of the axis color. The closest you can do is: ...

15 years ago | 0

Answered
How to move from one gui page to another by clicking push button?
I do this for things like help windows: # Set the |'Tag'| property in each window # In the callback, use |findobj| to find the ...

15 years ago | 2

Answered
Optimization Simple search
Can you explain what you want beyond |min(x)|?

15 years ago | 1

Answered
common colorbar
Hard to say without seeing the code, but it looks like there's some condition that makes it possible for |layoutColorbar| to com...

15 years ago | 0

| accepted

Answered
How to save statitiscs displayed in workspace as text file?
Do you mean you want a list of variable names, sizes, classes, bytes used,...? If so, you could do |vars = whos|, then save/wri...

15 years ago | 0

| accepted

Answered
errors in this code - 1D PDE with Boundary Condition
I don't know exactly what you're trying to do with |t| and |T| (and associated |nt| and |NT|), but the result is that |c| and |C...

15 years ago | 0

Load more