Answered

error using randi: size inputs must be scalar

you actually want to do for n=1:4 a{n}= randi(10,n)-1; b{n}= randi(10,n)-1; fprintf('n = %d:\n', n)...

error using randi: size inputs must be scalar

you actually want to do for n=1:4 a{n}= randi(10,n)-1; b{n}= randi(10,n)-1; fprintf('n = %d:\n', n)...

3 years ago | 0

Answered

How can I plot mean +/- 1 standard deviation for every data point in my dataset ?

have you looked up the function errorbar()? it should get you what you'll need

How can I plot mean +/- 1 standard deviation for every data point in my dataset ?

have you looked up the function errorbar()? it should get you what you'll need

3 years ago | 0

Answered

searching through RNA sequence for a string of characters

so, do you store the full compliment data in an array such that you can %gen dummy data comp = 'AGCT'; list = comp(ran...

searching through RNA sequence for a string of characters

so, do you store the full compliment data in an array such that you can %gen dummy data comp = 'AGCT'; list = comp(ran...

3 years ago | 0

Answered

Outputting gyroscope data to array

you're overwriting it with the p(n) as n only goes from 1 to 10 again and again. you'll have to increment p(#) beyond n or mult...

Outputting gyroscope data to array

you're overwriting it with the p(n) as n only goes from 1 to 10 again and again. you'll have to increment p(#) beyond n or mult...

3 years ago | 0

Answered

how to plot normalized column vs another colomn

must be missing something as you have it right there plot("your other column",i./max(i),'.') then you'd fit a line and e...

how to plot normalized column vs another colomn

must be missing something as you have it right there plot("your other column",i./max(i),'.') then you'd fit a line and e...

3 years ago | 0

Answered

How do I create an animation with a coloured sphere changing in time? (for climate modelling)

you can do something like this [x,y,z] = sphere(30); [sx sy]=meshgrid(-1:.01:1,-1:.01:1); I=3*sin(2*pi*2*sx)+cos(2*pi...

How do I create an animation with a coloured sphere changing in time? (for climate modelling)

you can do something like this [x,y,z] = sphere(30); [sx sy]=meshgrid(-1:.01:1,-1:.01:1); I=3*sin(2*pi*2*sx)+cos(2*pi...

3 years ago | 0

Answered

How to upload an image to a GUI frame?

so i take it you have an axes frame that you've tagged as imagedisplay. i'm curious why with said function you don't get warnin...

How to upload an image to a GUI frame?

so i take it you have an axes frame that you've tagged as imagedisplay. i'm curious why with said function you don't get warnin...

3 years ago | 0

Answered

Repeating If statement after variable change

not sure what you mean by repeat first with SS(1)==# as it wouldn't do the first if statement but the lower elseif statement. i...

Repeating If statement after variable change

not sure what you mean by repeat first with SS(1)==# as it wouldn't do the first if statement but the lower elseif statement. i...

3 years ago | 0

| accepted

Answered

How do I piece together a 2-dim image using 3 given images, each representing R, G, B?

you should be using cat(3,red,green,blue) because you want to stack in the 3rd dimension. x = randi(3,3,3) x = ...

How do I piece together a 2-dim image using 3 given images, each representing R, G, B?

you should be using cat(3,red,green,blue) because you want to stack in the 3rd dimension. x = randi(3,3,3) x = ...

3 years ago | 0

| accepted

Answered

Legend for a graph displaying multiple runs

you can look into specifying which points/lines are plotted in the legend() help documentation. I made a quick example that y...

Legend for a graph displaying multiple runs

you can look into specifying which points/lines are plotted in the legend() help documentation. I made a quick example that y...

3 years ago | 1

| accepted

Answered

I need to create a 3 by 3 window and calculate mean within the window. This window is to move through the image. How can I do it?

I would take a look at the conv() and conv2() function. you would use something like [1 1 1;1 1 1;1 1 1]/9 to get mean. and the...

I need to create a 3 by 3 window and calculate mean within the window. This window is to move through the image. How can I do it?

I would take a look at the conv() and conv2() function. you would use something like [1 1 1;1 1 1;1 1 1]/9 to get mean. and the...

3 years ago | 0

Answered

How to make a 2D graph from text file

I can point out a few things. # if you look at M isn't that what you're trying to plot with A? as it should include both c...

How to make a 2D graph from text file

I can point out a few things. # if you look at M isn't that what you're trying to plot with A? as it should include both c...

3 years ago | 0

Answered

how to replace values of a matrix, if another matrix meet certain conditions?

i may be over simplifying it but doesn't the greater than (>) inequality just do it? A=magic(5) B=A>18

how to replace values of a matrix, if another matrix meet certain conditions?

i may be over simplifying it but doesn't the greater than (>) inequality just do it? A=magic(5) B=A>18

3 years ago | 1

Answered

Pulse train with duty cycle variable.

why not try something like this: t=0:per/1000:per-per/1000; %define period normal = zeros(1,numel(t)); normal(t<per*dut...

Pulse train with duty cycle variable.

why not try something like this: t=0:per/1000:per-per/1000; %define period normal = zeros(1,numel(t)); normal(t<per*dut...

3 years ago | 0

Answered

Is there a way to remove the nested for loops from this segment of code? I'm trying to make the code generic so it can take in n-number of moment arrays.

to make it more generic you could do something like momentind = [1 1 1 1 1 1] cind = 1; while momentind(end)~=3;...

Is there a way to remove the nested for loops from this segment of code? I'm trying to make the code generic so it can take in n-number of moment arrays.

to make it more generic you could do something like momentind = [1 1 1 1 1 1] cind = 1; while momentind(end)~=3;...

3 years ago | 0

Answered

save snapshot image in a variable within a loop!!

from what i see get snapshot returns a NxMx(1 for mono 3 for color) and you're trying to stuff it into a 1x1. what you should t...

save snapshot image in a variable within a loop!!

from what i see get snapshot returns a NxMx(1 for mono 3 for color) and you're trying to stuff it into a 1x1. what you should t...

3 years ago | 0

Answered

Reading within parentheses in MATLAB

since you've got the right idea and cellfun() is troublesome and sometimes confusing, i've coded it for you here: dumdata...

Reading within parentheses in MATLAB

since you've got the right idea and cellfun() is troublesome and sometimes confusing, i've coded it for you here: dumdata...

3 years ago | 0

Answered

problem in for loop for plotting

do you mean you're missing the first spectrum because you put the figure after the first instance of subplot? you should move f...

problem in for loop for plotting

do you mean you're missing the first spectrum because you put the figure after the first instance of subplot? you should move f...

3 years ago | 0

| accepted

Answered

Loop to generate a folder and to join files in .txt format

without generating some dummy files here is how i see your loop and joining of the two files. you'll have to modify it dependin...

Loop to generate a folder and to join files in .txt format

without generating some dummy files here is how i see your loop and joining of the two files. you'll have to modify it dependin...

3 years ago | 0

Answered

Finding a point best representing the centre of density

I don't quite think you need to go that far as Image Analyst suggests. if i get it you have a consumption by time by user matri...

Finding a point best representing the centre of density

I don't quite think you need to go that far as Image Analyst suggests. if i get it you have a consumption by time by user matri...

3 years ago | 0

Answered

Putting information on a imshow graph

there is a function called title() x=rand(100,100);imshow(x),title('text')

Putting information on a imshow graph

there is a function called title() x=rand(100,100);imshow(x),title('text')

3 years ago | 0

Answered

How to Add Linear Trendline that Considers Errorbars

so if you want to take in the span of the error bars why not take into account the error bar points: clf; x = [1 2 3]'; ...

How to Add Linear Trendline that Considers Errorbars

so if you want to take in the span of the error bars why not take into account the error bar points: clf; x = [1 2 3]'; ...

3 years ago | 1

Answered

How to prevent overlapping of point values on a matlab plot?

why not put it in a legend if there are so few points points=[1 1.01;1 1]; figure,plot(points(1,1),points(1,2),'x',p...

How to prevent overlapping of point values on a matlab plot?

why not put it in a legend if there are so few points points=[1 1.01;1 1]; figure,plot(points(1,1),points(1,2),'x',p...

3 years ago | 1

| accepted

Answered

How I remove edge lines and add reference lines into contour plot generated with plot(array,'style','contour')?

you would do something like clf load variables plot_data = fit ([X, Y], Z, 'cubicinterp'); contourplot = plot(plot...

How I remove edge lines and add reference lines into contour plot generated with plot(array,'style','contour')?

you would do something like clf load variables plot_data = fit ([X, Y], Z, 'cubicinterp'); contourplot = plot(plot...

3 years ago | 0

| accepted

Answered

Plot over an image

I would check your points. i see that b and d are swapped, but is there sufficient distances for you to see it with the image b...

Plot over an image

I would check your points. i see that b and d are swapped, but is there sufficient distances for you to see it with the image b...

3 years ago | 1

| accepted

Answered

How to plot two matrices of different sizes in the same figure?

I would go with something like this %% gen 8x8 post grid figure(1),clf, surf([1:8],[1:8],zeros(8,8)),view([0 90]), ho...

How to plot two matrices of different sizes in the same figure?

I would go with something like this %% gen 8x8 post grid figure(1),clf, surf([1:8],[1:8],zeros(8,8)),view([0 90]), ho...

3 years ago | 0

Answered

How to sum up specific pixel intensities in image?

you can use logical ">" to find the values greater than 120 example = magic(10); ind=find(example>50); sumintent = sum(e...

How to sum up specific pixel intensities in image?

you can use logical ">" to find the values greater than 120 example = magic(10); ind=find(example>50); sumintent = sum(e...

4 years ago | 0

Answered

How to count data cursors and assign a fixed number to each?

you can change things around and use something like this: hfig = figure;plot(1:10,[1:10].^2) hcursor = datacursormode(hf...

How to count data cursors and assign a fixed number to each?

you can change things around and use something like this: hfig = figure;plot(1:10,[1:10].^2) hcursor = datacursormode(hf...

4 years ago | 0

Answered

How to change displayed plot in a GUI with pop-up menu.

Yes.... look at the guide quick start templates. type in guide into the workspace and it'll open the quick start window. Selec...

How to change displayed plot in a GUI with pop-up menu.

Yes.... look at the guide quick start templates. type in guide into the workspace and it'll open the quick start window. Selec...

4 years ago | 0

| accepted

Answered

Hi,,I am trying to generate a shift register in matlab .IS it possible?I am explaining the problem below.Thanks in Advance

look up the function circshift()

Hi,,I am trying to generate a shift register in matlab .IS it possible?I am explaining the problem below.Thanks in Advance

look up the function circshift()

4 years ago | 0