Beantwortet
Having trouble with while loops problem
Here are some things that are wrong: # You're entering separate numbers x,y for the arithmetic and geometric means (you should ...

etwa 15 Jahre vor | 1

| akzeptiert

Beantwortet
VERY Nonlinear Data Fitting
If you have the <http://www.mathworks.com/products/statistics/ Statistics Toolbox>, you could use <http://www.mathworks.com/help...

etwa 15 Jahre vor | 2

| akzeptiert

Beantwortet
"solve" Function
Here is one way: x=sym(input('x = ')) y=sym(input('y = ')) syms z z=solve(z-x-y,z)

etwa 15 Jahre vor | 0

Beantwortet
minimise two functions simultaneously
I'm not sure if I understand your problem, so here is my interpretation. Let's say eqs = f(t,K) is your system, where K...

etwa 15 Jahre vor | 0

Beantwortet
how to perform symbolic factorial ?
You can use gamma(n+1) to get n factorial. Gamma is a generalization of factorial to real numbers. (edited to apply Walter'...

etwa 15 Jahre vor | 0

Beantwortet
tri2grid anyone??
Although |u| is called a function, it's really a vector representing the values of the function on the mesh. |tri2grid| is inten...

etwa 15 Jahre vor | 0

Beantwortet
how to generate numbers randomly
You can use <http://www.mathworks.com/help/techdoc/ref/rand.html rand> to generate random numbers.

etwa 15 Jahre vor | 0

| akzeptiert

Beantwortet
MATLAB one-liners
Here is a real beauty from a comment by <http://www.cise.ufl.edu/~davis/ Tim Davis> on a <http://blogs.mathworks.com/loren/2008/...

etwa 15 Jahre vor | 1

Beantwortet
When shall I contact MathWorks' Technical Support and how?
Problems installing a product should be referred to Technical Support.

etwa 15 Jahre vor | 2

Beantwortet
Deriving Max with fmincon when contraints differ
If I understand your request, you want the matrix S to have two columns containing the values of Aeq and two columns containing ...

etwa 15 Jahre vor | 1

| akzeptiert

Beantwortet
Solve a nonlinear system
Is this what you're trying to do? f = @(x) [1/(1+x(1)) - .95; 0.08/(1+x(1)) + 1.08/(1+x(2))^2 - .99]; R = fsolve(f,[0 ...

etwa 15 Jahre vor | 0

| akzeptiert

Beantwortet
MATLAB one-liners
Here is an interesting way of calculating n rows of Pascal's triangle: round(expm(diag(1:n-1,-1))) Now if we could just ...

etwa 15 Jahre vor | 0

Beantwortet
MATLAB one-liners
Turn a structure array S into a cell array with the names of the fields in the first column: C = horzcat(fieldnames(S), squ...

etwa 15 Jahre vor | 1

Frage


MATLAB one-liners
One of the joys of using MATLAB is that it has a stock of matrix functions like |diff|, |sort|, |all|, and so on, that can be co...

etwa 15 Jahre vor | 10 Antworten | 7

10

Antworten

Beantwortet
Testing for identical numbers in matrix columns
Here is one way: find(~sum(abs(diff(A)))) The idea is that |diff| takes the differences between adjacent terms in a column, ...

etwa 15 Jahre vor | 1

Beantwortet
Suppressed output after code error in publish
I have submitted a bug report on this. *EDIT:* The response from Matlab Support is that it's not a bug but inadequate documenta...

etwa 15 Jahre vor | 0

Beantwortet
lsqcurvefit
Since the distance between two complex numbers a+i*b and c+i*d is (a-c)^2 + (b-d)^2, you could treat each complex number as a pa...

etwa 15 Jahre vor | 0

| akzeptiert

Beantwortet
What is the "best" way to Generate a Bernoulli Process?
Interesting question. The number of wasted bits depends on the number of bits you need to define p. If p = 1/sqrt(3), no wasted ...

etwa 15 Jahre vor | 0

Beantwortet
warning: badly scaled matrix
This is a lot of code! You could start by finding where the warning is generated. Type dbstop if warning before running ...

etwa 15 Jahre vor | 0

Beantwortet
"vertcat" error with array of strings
That commented line is just like having an empty line in the middle of your command (try it!). You could do this: input_fil...

etwa 15 Jahre vor | 1

Frage


Suppressed output after code error in publish
When I try to publish code that contains an example of a command that returns an error, the output for all code up to and includ...

etwa 15 Jahre vor | 2 Antworten | 0

2

Antworten

Beantwortet
Vectorization of Integral (or quad) to avoid employing a double loop
You could eliminate one loop by using <http://www.mathworks.com/help/techdoc/ref/quadv.html quadv>: x = -2:0.1:2; y = x; [X,Y...

etwa 15 Jahre vor | 0

| akzeptiert

Beantwortet
Showing x-axis & y-axis
Have you tried axis on ?

etwa 15 Jahre vor | 0

Frage


Is there more than one way to make a class abstract?
In the <http://www.mathworks.com/help/techdoc/matlab_oop/brgxk22-1.html#brgxk22-2 documentation for abstract classes>, the only ...

etwa 15 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


How are method names with a dot in them accessed in classes?
In the tutorial <http://www.mathworks.com/help/techdoc/matlab_oop/brfyl44-1.html Implementing a Set/Get Interface for Properties...

etwa 15 Jahre vor | 2 Antworten | 0

2

Antworten

Beantwortet
Implementing an hgsetget subclass
O.k., this works: classdef unit < hgsetget % This is just a test class for using SET in an HGSETGET subclass. p...

etwa 15 Jahre vor | 0

| akzeptiert

Beantwortet
Implementing an hgsetget subclass
Here is a simple attempt to get the full functionality: classdef unit < hgsetget % This is just a test class for using SET...

etwa 15 Jahre vor | 0

Beantwortet
What matlab easter eggs do you know?
<http://www.eeggs.com/tree/422.html This site> and <http://www.mathfail.com/2010/06/hidden-matlab-fun-easter-eggs.html this site...

etwa 15 Jahre vor | 1

Beantwortet
Non-Linear Dynamical Systems - Iteration Help? (Beginer)
I don't want to just do your homework for you, so here are a few hints that will help with the Matlab syntax. First, make a loop...

etwa 15 Jahre vor | 0

| akzeptiert

Beantwortet
normal random number generator with specified zone
If a uniform distribution will do, you could try rand*2-1 See documentation for <http://www.mathworks.com/help/techdoc/r...

etwa 15 Jahre vor | 1

Mehr laden