Answered
FMINUNC cannot continue.
You have to save your function _myfun_ in separate file _myfun.m_ function [ f ] = myfun( x ) f = 3*x(1)^2 + 2*x(1)*x(2) + ...

14 years ago | 1

| accepted

Answered
complex number
Z = R.*exp(1i*theta) where: R = abs(Z)% magnitude theta = angle(Z) % angle

14 years ago | 2

Answered
How to cite a User's Guide?
I would like to cite <http://www.mathworks.com/help/pdf_doc/gads/gads_tb.pdf Global Optimization Toolbox User’s Guide>. Wha...

14 years ago | 0

Answered
data genaration
See in documentation: doc randn

14 years ago | 0

| accepted

Answered
About Ylim
Get ylim value from current axis, and then set limit from zero to maximum (second) value: plot(randn(1000,1)) yl = get(g...

14 years ago | 0

Answered
string as input for function
Are you sure that you have not done a typo in the filename? I've tested your functions, and they work.

14 years ago | 0

| accepted

Answered
Time dependent programs?
Use *timer*: <http://www.mathworks.com/help/techdoc/matlab_prog/f9-38055.html>

14 years ago | 0

Answered
how to represent binary values as polynomial expression?
My suggestion: a=1011 tmp = sprintf('%i',a); a = str2num(sprintf('%c ',tmp(:))); poly2sym(a)

14 years ago | 0

| accepted

Answered
Error in displaying output
A=[1;2;3;4;0;0;0;0]; for i=1:size(A) if A(i)==0 A1= 'good'; else A1= 'bad'; ...

14 years ago | 0

| accepted

Answered
Problem to plot graph....
Use *text* command: <http://www.mathworks.com/help/techdoc/ref/text.html>

14 years ago | 0

| accepted

Answered
issues with fprintf
K = {'text1'; 'text2'}; arrayfun(@(idx)fprintf('blahhh blahh %s blahh bahh\n',K{idx}),1:numel(K))

14 years ago | 1

| accepted

Answered
How to draw any figure in MATLAB by pressing and dragging the mouse
<http://www.mathworks.com/matlabcentral/fileexchange/8262-freehand-contour-drawing>

14 years ago | 0

Answered
Axis labelling in MATLAB plot
Your LaTeX strings are incorrect, see: <http://www.codecogs.com/latex/eqneditor.php> They should look something like this: ...

14 years ago | 0

Answered
GUI Pushbutton
Do you mean something like this? function test x = 1:20; y = sqrt(x)+randn(size(x)); plot(x,y,'--.') hold o...

14 years ago | 0

Answered
fprintf: writing text lists to .txt files
You have to change round brackets into curly brackets: assets = {'first','second','third','fourth'}; fid = fopen('assets...

14 years ago | 0

| accepted

Answered
fprintf: writing text lists to .txt files
Probably: fprintf(fid, '%s\n', assets{row});

14 years ago | 0

Answered
i need the matlab program codes to run
See this well-known article: <http://sprott.physics.wisc.edu/pubs/paper212.htm>

14 years ago | 1

Answered
Fill values from different matrices size
For example: a = rand(3); b = zeros(6); b(1:2:end,1:2:end) = a

14 years ago | 0

| accepted

Answered
how to continue the program?
Ctrl+C break the execution of the program and you can't continue after it. Can you write why you need it for? Maybe there is ...

14 years ago | 0

Answered
Foucault Pendulum
You have to rewrite your equations: x'' + C*x - 2*P*y' = 0 y'' + C*y + 2*P*x' = 0 to form: u = y' --> u' = y'' ...

14 years ago | 0

Answered
Foucault Pendulum
First of all you have to reduce the order of an ODEs: <http://www.mathworks.com/support/tech-notes/1500/1510.html#reduce> ...

14 years ago | 0

| accepted

Answered
sine gordon
<http://www.rz.uni-karlsruhe.de/~ae70/SOLIT_WAVES/SGEhandout4.pdf>

14 years ago | 0

Answered
set variable to data that is loaded
If you are sure that you load only one matrix: fName = fieldnames(x); eval(['x = x.' fName{1} ';']) Another possibility: ...

14 years ago | 1

Answered
error occuring
Should be: if (N_red == 3) & (difference_red<0.1)

14 years ago | 0

Answered
Sum of sines fitting algorithm: What is happening to the phase value?
Your function is periodic so there is an infinite phase shifts, that will be a good answer. You could add a constraints in fi...

14 years ago | 0

Answered
wrap and center justify axes and tick label
Analyze this example: plot(1:5) xTick = 1:5; set(gca,'xtick',xTick) yTick = get(gca,'ytick'); set(gca,'xticklab...

14 years ago | 1

| accepted

Answered
PLOT in MATLAB
x = rand(100,1)*3.5; axes('Units','normalized','Position',[.1 .1 .8 .8]) plot(x) axes('Units','normalized','Position'...

14 years ago | 0

| accepted

Answered
How to save an image displayed ?
I'm not sure if I understood you well: figure, imshow('pout.tif'); h = imfreehand(gca); . . . axis off p...

14 years ago | 0

Answered
Interpolating Irregularly Spaced Data
Use *interp1* function: interp1(col1,col2,col1(1):.1:col1(end))

14 years ago | 0

Answered
Getting "Matrix dimensions must agree." warning, please help.
Add the necessary dots: x = -1:0.3:2 y = -(1./((x-0.3).^2+0.01)+1./((x-0.9).^2+0.04)) plot(x,y)

14 years ago | 1

| accepted

Load more