Answered
Different result command window and guide
John, in your expression you have two huge terms, basically, Inf/Inf which results in a |NaN|. You should get the same re...

12 years ago | 0

Answered
How can I plot loglog(x,y) with an xlim and ylim?
Christopher, move the |xlim| and |ylim| commands *after* the |loglog| command. Make sure that |x > 0|.

12 years ago | 1

| accepted

Answered
Combine surf and scatter3 in one axes
Thomas, what happens if you execute the following code? With and without the |get| command? k = 5; n = 2^k-1; ...

12 years ago | 0

| accepted

Answered
How to print multiple strings in plot title?
Matt, use |strcat| to individually define (concatenate) strings as plot titles. As an example for ii = 1:N ... str =...

12 years ago | 2

Answered
how can i plot two graph in single one without subplot?
Use hold all before or after the first |plot| command.

12 years ago | 0

| accepted

Answered
How can I do contour plot?
Francesco, that is correct. |Z| must be a matrix, see for example (from the documentation) [X,Y] = meshgrid(-8:.5:8); % c...

12 years ago | 1

| accepted

Answered
how to detect peaks in a particular range?
Ankita, you could simply limit your data in [pks,locs] = findpeaks(data) to cover only the frequency range between 0 and...

12 years ago | 4

| accepted

Answered
how to merge two column into a single column
Ashok, use C = [A; B];

12 years ago | 0

| accepted

Answered
integration in matlab - error
Rasmus, use fun = @(x) 3*(sin(x).^4)./x.^4; sin^4 x is just another way of writing (sin(x))^4.

12 years ago | 0

| accepted

Answered
Help solving a trignometric equation
Mischa, what MATLAB version are you using? Try syms lambda real;

12 years ago | 0

Answered
Reading file names with case insensitivity
You could use the <http://www.mathworks.com/help/matlab/ref/lower.html |lower|> command to convert the file name string to lower...

12 years ago | 1

| accepted

Answered
Error using * Inner matrix dimensions must agree - using meshplot
Will, use [t y] = meshgrid(0:0.5:2,-4:0.5:4); dy = t.^2.*exp(2*t) + 2.*y; % need to use dot operators all the way ...

12 years ago | 0

| accepted

Answered
problem with fminunc: why the returned gradient is not a vector
Chuoxin, have you set options = optimset('GradObj','on') % gradient outputted as 2nd argument or the equivalent throug...

12 years ago | 1

Answered
how to initialize a vector of structure
XAXRXTX, check out the <http://www.mathworks.com/help/matlab/matlab_prog/memory-requirements-for-a-structure-array.html document...

12 years ago | 0

Answered
how can i use 'If' statement for this 00000,10000,11000,11100,11110,11111 six 5bit values using 'OR' logical operator inside IF satement ?
Use if (strcmp(O1,'00000') || strcmp(O1,'10000') || strcmp(O1,'11000')) The three conditions need to be evaluated separat...

12 years ago | 1

| accepted

Answered
Hi I am trying to solve a system of equations using fsolve or something similar with 4 variables. Please help
Rishav, try function r = test(r0) % options = optimoptions('fsolve','Display','iter'); % new as of R2013a % options =...

12 years ago | 0

| accepted

Answered
mldivide test doesnt work.
Derck, you are working with an overdetermined system: 1024 equations in 4 unknowns. Chances that the system results in an exact ...

12 years ago | 0

Answered
how to generate full wave rectified sine wave?
Hello Thar, attach an |Abs| (for absolute) block from the Math Operations library to the |Sine Wave| generator (Sources). In the...

12 years ago | 0

| accepted

Answered
How to plot a contour plot with the next data
Hello Sebastian, I assume |A| is the x-parameter, |B| is the y-parameter? x = linspace(0.28,0.40,9); y = linspace(1200,140...

12 years ago | 0

| accepted

Answered
lokal minimum and maximum
Hello Rasmus, how about doing it symbolically? syms x t = x^3 - 6*x^2 - x + 30; rootsdt = double(solve(diff(t)==...

12 years ago | 0

Answered
How to check the type of input
Sarah, use the <http://www.mathworks.com/help/matlab/ref/isnumeric.html |isnumeric|> command (see example <http://www.mathworks....

12 years ago | 0

| accepted

Answered
how to create ramp signal ?
Thar, use the Ramp block (Sources). By double-clicking the block you can define the slope (5/8) and the initial output (-7) of t...

12 years ago | 0

| accepted

Answered
How can I obtain the data from the scope for a waveform
One option would be to add a Digital Clock block as shown below and set the sampling time to |4.85|. This way this time stamp is...

12 years ago | 2

| accepted

Answered
Consider only a positive numbers of the first columns.
Use B = A(find(A(:,1)>0),:) Concerning your second question: that, of course, depends on how your cell array looks like. ...

12 years ago | 0

| accepted

Answered
writing objective function for error optimization
Navid, I believe, that's what you would like to do: function test() % setting up optim. problem ...

12 years ago | 0

Answered
Why is a nested loop necessary in this code?
Ashkhan, the *outer (first) loop* is used to step through all the numbers that are analyzed. To identify a prime number you need...

12 years ago | 0

Answered
how to calculate max and mean for big matrix 10*155 but i need to pick the value after coloumn 50?
Benjamin, use max_mat = max(mat(:,51:end),[],2) mean_mat = mean(mat(:,51:end),2) assuming you want to compute max and ...

12 years ago | 1

| accepted

Answered
How can I create a for loop inside another for loop for a geometric series?
Amy, check out Nin = inputdlg('Enter space-separated numbers:', 'N vector', [1 50]); N = str2num(Nin{:}); x = [...

12 years ago | 0

| accepted

Answered
Dots in plot are either too big or too small.
Matthew, you might want to try a different marker, such as |o| or |*| . plot(x,y,'o','MarkerSize',sz) For some of these y...

12 years ago | 0

| accepted

Answered
How can I use one variable between two function ?
Dipten, you can simply pass those variables as input and output parameters between your functions. E.g. function val1 = my_f...

12 years ago | 0

| accepted

Load more