Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to my program give a image to user and user by mouse choose a pixel,then spatial information of pixel return to program for another process.
how write code for it in matlab ?
Try this:
A=imread('your image');
imshow(A);
impixelinfo;
[c, r, vals] = impixel;
c and r are arrays of all the columns and rows of the part of the image that user clicked on and vals are the RGB values of each point.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
t=-10:0.001:10
x=sinc(t);
subplot(321)
plot(t,x)
title 'orignal sinc wave'
%x(-t)
a=sinc(-t);
subplot(322)
plot(t,a)
title 'negative'
b=(x+a)*1/2;
subplot(323)
plot(t,b)
title 'even part of the signal'
c=(x-a)*1/2;
subplot(324)
plot(t,c)
title 'odd part of the signal'
d=c+b;
subplot(325)
plot(t,d)
sinc(t) is a symmetric function, so x=sinc(t)=sinc(-t)=a, thus, your panel 4, c=(x-a)*1/2 yields exactly 0 for all t values.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Is it possible to plot bars with filled pattern in Matlab, like this figure?
I attempted to use applyhatch_pluscolor link however, I couldn't make it work (attempt below). Is there an easy / feasible alternative?
Test code:
bar(rand(3,4));
[im_hatch,colorlist] = applyhatch_pluscolor(gcf,'\-x.',1,[],[],150);
Then I changed the source code, from bits = hardcopy(h,'-dzbuffer',['-r' num2str(dpi)]); to bits = print(h,'-RGBImage',['-r' num2str(dpi)]);.
I got the figure below. However, this is still far away form the desired result.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have been trying for a while to get this to work but I don't seem to be getting any closer to a solution.
I'm not sure of what the pattern is and what to write for the "d" value in a:d:b
Clearly you want to start from 0 (a) and go to 2*pi (b).
Now the question comes what is your step size (d)?
From your example you can see that you are changing from 0 to pi/n.
And from pi/n to 2*pi/n.
This means your step size is d=pi/n
Once you defined your n, e.g:
n=10;
you can do the rest like this:
x=0:(pi/n):(2*pi)
y=sin(x);
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
Could someone explain me what I must change in my model?
Model
The error messages are pretty clear and self-explanatory. The reason you get the error is because B is of dimension 4x2 and you are trying to do B * Xr where Xr is of dimension 1. According to your equation, you need to do B*U where U = [dXr/dt; Xr];. However, using the derivative block is never a good idea in Simulink if you can avoid it, especially with a step input. Think about how you want to formulate the inputs to your state-space.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to create a picture from different pictures, i.e., a photo mosaic. I have 10 sample pictures to create an image of the Mona Lisa. I cropped those pictures to 150*(32x32) from 1*(480x320) for increase sample. I made vectors with those pictures and used k-means algorithm for clustring, but I am stuck.
How can I do this with Matlab?
Here is an example
You can do this by making a GUI-program in Matlab. So fare, you have to implement some functions like these:
function handles = loadImage(handles)
function resizeThumbs(path,thumbSize)
function handles = loadThumbs(handles)
function handles = genMosaic(handles)
If you have further questions ask.