Risposto

sprintf with leading minus sign

Not sure you can eliminate the minus sign. I think what you are saying is basically if(abs(x)<1e-2) x =0; end

sprintf with leading minus sign

Not sure you can eliminate the minus sign. I think what you are saying is basically if(abs(x)<1e-2) x =0; end

oltre 9 anni fa | 0

Risposto

3D Plot - term structure

That is a mesh plot. % here I'm making up data with the same sizes as yours dates = 1:224; maturities = (1:10)'; valu...

3D Plot - term structure

That is a mesh plot. % here I'm making up data with the same sizes as yours dates = 1:224; maturities = (1:10)'; valu...

oltre 9 anni fa | 0

| accettato

Risposto

How can i find the derivative of a vector?

You can do that approximately. % this is the "finite difference" derivative. Note it is one element shorter than y and x ...

How can i find the derivative of a vector?

You can do that approximately. % this is the "finite difference" derivative. Note it is one element shorter than y and x ...

oltre 9 anni fa | 1

| accettato

Risposto

Help with plot legend

Not very sure, but I guess that the problem might be in some of the elements of h being zero, on account of the condition about ...

Help with plot legend

Not very sure, but I guess that the problem might be in some of the elements of h being zero, on account of the condition about ...

oltre 9 anni fa | 1

| accettato

Risposto

Toc returns loop time instead of total script time

Hi, I've tried this tic; for k=1:10 pause(2); toc; end pause(2); toc; on both R2012b and R2014b and th...

Toc returns loop time instead of total script time

Hi, I've tried this tic; for k=1:10 pause(2); toc; end pause(2); toc; on both R2012b and R2014b and th...

oltre 9 anni fa | 0

Risposto

Turning part circle into circle segment

I'd add a final point coincident with the first one Kreis=[Kreis Kreis(:,1)]; Then plot3(Kreis(1,:),Kreis(2,:),Kreis(...

Turning part circle into circle segment

I'd add a final point coincident with the first one Kreis=[Kreis Kreis(:,1)]; Then plot3(Kreis(1,:),Kreis(2,:),Kreis(...

oltre 9 anni fa | 0

Risposto

Matlab : 2 x-axis with one plot

I guess that the problem is that the y axis of ax2 overlaps with that of ax1, and the ticks are different. You can remove the t...

Matlab : 2 x-axis with one plot

I guess that the problem is that the y axis of ax2 overlaps with that of ax1, and the ticks are different. You can remove the t...

oltre 9 anni fa | 0

| accettato

Risposto

How to plot left and right y-axis that belong to the same data points

So if I get it right, you want to represent _the same data_ using different units. I can see why plotyy is not the right tool. ...

How to plot left and right y-axis that belong to the same data points

So if I get it right, you want to represent _the same data_ using different units. I can see why plotyy is not the right tool. ...

oltre 9 anni fa | 1

| accettato

Risposto

plottyy and linkprop, xtick overlaping with two set of data contain large axis range difference

I tried your code out. Both lines are plotted, but (x1,y1) is clearly flattened on the y axis (leftmost part of the window)....

plottyy and linkprop, xtick overlaping with two set of data contain large axis range difference

I tried your code out. Both lines are plotted, but (x1,y1) is clearly flattened on the y axis (leftmost part of the window)....

oltre 9 anni fa | 0

Risposto

Improve performance of linspace

are you sure that it is a matter of linspace? Did you try profiling your code? I'd say the "problem" is in the sin function, ...

Improve performance of linspace

are you sure that it is a matter of linspace? Did you try profiling your code? I'd say the "problem" is in the sin function, ...

oltre 9 anni fa | 0

Risposto

Any suggestions for this code?

tmp = input('Please enter the first coordinates in this form [# #]: '); x1=tmp(1); y1=tmp(2); and so on...

Any suggestions for this code?

tmp = input('Please enter the first coordinates in this form [# #]: '); x1=tmp(1); y1=tmp(2); and so on...

oltre 9 anni fa | 0

| accettato

Risposto

Find corresponding dates in a calendar

The error you get is self explaining, I think. ISM_krock contains many zeros (apparently columns 4 to 6 entirely consist of zero...

Find corresponding dates in a calendar

The error you get is self explaining, I think. ISM_krock contains many zeros (apparently columns 4 to 6 entirely consist of zero...

oltre 9 anni fa | 0

| accettato

Risposto

Change color of different spheres

Where exactly are you specifying the sphere color? Because it seems to me that in the above command you're not. You should...

Change color of different spheres

Where exactly are you specifying the sphere color? Because it seems to me that in the above command you're not. You should...

oltre 9 anni fa | 2

Risposto

How to add the recent value of a variable to the end of the name of another variable as a suffix?

I think this can be done through the function "eval". However, your strategy seems impractical. Why don't you add a dimension...

How to add the recent value of a variable to the end of the name of another variable as a suffix?

I think this can be done through the function "eval". However, your strategy seems impractical. Why don't you add a dimension...

oltre 9 anni fa | 0

Risposto

how to perform jump condtion or alternative solution for calling

Not very clear. I'm not sure I understand what you want. I'm guessing here. You have an array X (what's its size?) The...

how to perform jump condtion or alternative solution for calling

Not very clear. I'm not sure I understand what you want. I'm guessing here. You have an array X (what's its size?) The...

oltre 9 anni fa | 0

Risposto

how to plot waterfall FFT

have you taken a look at the documentation of the "waterfall" function? You can do that by typing doc waterfall I'm not s...

how to plot waterfall FFT

have you taken a look at the documentation of the "waterfall" function? You can do that by typing doc waterfall I'm not s...

oltre 9 anni fa | 0

Risposto

HELP! All combinations of array of vectors

If I get your problem right, you could use "combnk" If V is a vector with the indices of your N's, e.g. V = 1:10 then...

HELP! All combinations of array of vectors

If I get your problem right, you could use "combnk" If V is a vector with the indices of your N's, e.g. V = 1:10 then...

oltre 9 anni fa | 0

| accettato

Risposto

How to find the another values in array

You could use the command "find". % this finds the row (if any) at which N appears in the first column of A r = find(A(:,1...

How to find the another values in array

You could use the command "find". % this finds the row (if any) at which N appears in the first column of A r = find(A(:,1...

oltre 9 anni fa | 0

| accettato

Risposto

identify different filname in different group

It's not very clear to me what you mean by "group the files in matlab". Anyway, one possibility is perhaps to discriminate th...

identify different filname in different group

It's not very clear to me what you mean by "group the files in matlab". Anyway, one possibility is perhaps to discriminate th...

oltre 9 anni fa | 0

Risposto

hi , i have this code..

Well... you can simply shift your time scale. Anyway your xlim is less than the range of t. If Dt is your translation (in your ...

hi , i have this code..

Well... you can simply shift your time scale. Anyway your xlim is less than the range of t. If Dt is your translation (in your ...

oltre 9 anni fa | 0

| accettato

Risposto

using if, else-if and else

If I get it right, you have an array and you want to find its first value (index-wise) less than 5. If this is the case, and t...

using if, else-if and else

If I get it right, you have an array and you want to find its first value (index-wise) less than 5. If this is the case, and t...

oltre 9 anni fa | 0

| accettato

Risposto

Issue with minor and major grid line styles

I stumbled on this problem as well. I think you need to set the ticks manually. set(gca,'xtick',200:200:1000); set(gca,'yt...

Issue with minor and major grid line styles

I stumbled on this problem as well. I think you need to set the ticks manually. set(gca,'xtick',200:200:1000); set(gca,'yt...

oltre 9 anni fa | 0

Risposto

Plotting on y-axis in form of offset for clarity ?

your solution should work, provided you close the parentheses plot(A(:,1),A(:,3)-0.3); plot(A(;,1), A(:,4)+0.3); didn'...

Plotting on y-axis in form of offset for clarity ?

your solution should work, provided you close the parentheses plot(A(:,1),A(:,3)-0.3); plot(A(;,1), A(:,4)+0.3); didn'...

oltre 9 anni fa | 0

Risposto

how to store function [x] = input('blah')

As far as I understand you want that the input variable to be a number called guess. For your usage of the input function that ...

how to store function [x] = input('blah')

As far as I understand you want that the input variable to be a number called guess. For your usage of the input function that ...

oltre 9 anni fa | 0

| accettato

Risposto

Define a curve in terms of (X,Y) values

I assume that B is in a single matrix. The light point should then correspond to matrix elements above some threshold. If this i...

Define a curve in terms of (X,Y) values

I assume that B is in a single matrix. The light point should then correspond to matrix elements above some threshold. If this i...

oltre 9 anni fa | 0

Risposto

How to plot a square wave with specific conditions?

That should simply be ys = (y>5); plot(t,y,'b',t,ys,'r')

How to plot a square wave with specific conditions?

That should simply be ys = (y>5); plot(t,y,'b',t,ys,'r')

oltre 9 anni fa | 0

| accettato

Risposto

How do I get rid of lines on a surf command? Also how do I change the surf to green rather than the default gradient colours?

It seems to me that you're guessing the syntax here. Better go through the handles. h = surf(xp,yp,zp) get(h) gives yo...

How do I get rid of lines on a surf command? Also how do I change the surf to green rather than the default gradient colours?

It seems to me that you're guessing the syntax here. Better go through the handles. h = surf(xp,yp,zp) get(h) gives yo...

oltre 9 anni fa | 0

Risposto

How to remove columns from matrix?

for that particular matrix you want B = A(:, [1 2 4 7]); If this is a more general problem, that's a bit more tricky. Sho...

How to remove columns from matrix?

for that particular matrix you want B = A(:, [1 2 4 7]); If this is a more general problem, that's a bit more tricky. Sho...

oltre 9 anni fa | 0

Risposto

How can I build an trendline through a fixed point?

Is that a straight line or a curve? And, in the second case, which curve? In the first case you're basically expecting that ...

How can I build an trendline through a fixed point?

Is that a straight line or a curve? And, in the second case, which curve? In the first case you're basically expecting that ...

oltre 9 anni fa | 0

Risposto

How to find centroid based on clusterdata?

I guess your variables are cells... Your syntax is not very clear to me. Anyway it should be c1 = [ mean(xArray{1}) mean(...

How to find centroid based on clusterdata?

I guess your variables are cells... Your syntax is not very clear to me. Anyway it should be c1 = [ mean(xArray{1}) mean(...

oltre 9 anni fa | 0

| accettato