Answered
Display numerical output with sprintf?
text = sprintf('You completed %d key presses.', numPresses); Screen(window, 'DrawText', text, ceil(resX/2)-60, ceil(res...

11 years ago | 0

| accepted

Answered
I am Not able To sort Out How to achieve This.
You could simplify your code I = rgb2gray(imread('peppers.png')); T = 'Hallo World'; I(1,1:length(T)) = uint8(T); ...

11 years ago | 1

| accepted

Answered
Want image appear when click in axes?
Like this? imshow('peppers.png') axis on

11 years ago | 0

Answered
How can i make a 3D plot that is made of many 2-points line with a direction
quiver3 is the function that you need M = rand(100, 6); ind = 1:20:size(M, 1); quiver3(M(ind, 1), M(ind, 2), M(...

11 years ago | 0

| accepted

Answered
How can you transform a color x3uint8 image to uint8?
No, because for each pixel 2^(8+8+8) different colors are possible.

11 years ago | 0

| accepted

Answered
how to divide an image 512x512 into 4x4 overlapping blocks.
If you do something for N times for M times you do it for N*M times, i.e. for (e-3)*(f-3) times in your example. No need to use ...

11 years ago | 1

Answered
How to create an array out of a matrix based on criteria.
b = a(1,:); c = []; for i = 2:size(a, 1) if ~isempty(intersect(a(i,:), b)) b = union(b, a(i,:)); else ...

11 years ago | 0

| accepted

Answered
How to use multiple outputs from function
Why not z = x + y;

11 years ago | 1

| accepted

Answered
Two for loops, one loop completes for each step of another loop... Or a better way of doing finding the different combinations of elements in a vector that sum to target value
v1 = 100:100:1000; v2 = 100:100:1000; [V1 V2] = meshgrid(v1, v2); ind = find(abs(V1 + V2 - 1000) < 10); o1 = [.60 .61...

11 years ago | 0

| accepted

Answered
How to plot a polynomial function multiplied by a row vector
for k = 0:M p = p + a(k+1)*x.^k; end;

11 years ago | 0

Answered
problems with the step size in a for loop
Allocate Q to be a vector of 10 NaNs (not a number) before doing the computations Q = nan(1,10);

11 years ago | 1

Answered
What kind of loop for this equation?
theta = 0:360; l = 300:800; [Theta, L] = meshgrid(theta, l); Z = cos(Theta/180*pi)./L; mesh(theta, l, Z)

11 years ago | 2

Answered
Matlab R 2014 a not workin on official Yosemite Update?!
http://www.mathworks.com/matlabcentral/answers/159003-why-am-i-unable-to-install-or-start-matlab-on-os-x-10-10-yosemite

12 years ago | 0

Answered
For-loop show an element which has format number different with others in an array?
This is because mwl is not exactly 300 but 300 + 5.6843e-014. Either use mwl = round([0:dwl:str2double(chieuchimd)]*100...

12 years ago | 1

| accepted

Answered
how to check values in a cell is smaller than a certain number?
Because it's a 1 x 12 cell you can address the i'th cell using E{i} for i = 1:12 smallvalues = E{i}(E{i} < 15.5); ...

12 years ago | 1

Answered
about reading strings with strread using a name of variable the string is allocated to
Get rid of the extension '.fit' [pathstr name ext] = fileparts(A); starting_number = strread(name, 'capture_%03d');

12 years ago | 1

Answered
Finding average of iterated curves
Write a function "fullcode" that returns your curve, than you can use something like this for i = 1:N result(i,:) = fu...

12 years ago | 0

Answered
How to reshape a matrix from a vector?
If, e.g., 200 is the desired size, just use vec(200) = 0; All values between 105 and 200 will be filled with zeros.

12 years ago | 0

| accepted

Answered
Create matrix with randomly distributed integers, with exact relative abundances
values = [0:4]; mo = [0 0.5533 0.1346 0.1167 0.1954]; a = 100; b = 100; % create a vector where each value appear...

12 years ago | 0

Answered
xoring bits within a vector
Use space between the the 1's and 0's M = [1 0 1 1 0 1 1 1 0 0 1 1 ; 1 0 0 1 1 0 1 1 0 1 0 1 ; 0 1 1 1 1 0 0 1 1 0 0 1 ; 1 ...

12 years ago | 1

| accepted

Answered
Need help with plotting a graph on matlab- linewidth
The help for plot states that "The X,Y pairs, or X,Y,S triples, can be followed by parameter/value pairs to specif...

12 years ago | 0

| accepted

Answered
Mesh plot with only every nth line plotted?
If you reduce the number of lines the plot will usually be less accurate, unless in special cases where you have, e.g., a plane....

12 years ago | 0

Answered
Hating this ->"Subscripted assignment dimension mismatch"
matrizcerostamaB(firstrow:firstrow+rowA-1,firstcolumn:firstcolumn+columnA-1)=imagenA;

12 years ago | 0

Answered
Getting a mean of only the numbers
Use nanmean

12 years ago | 1

Answered
Creating a heat map that would color different sectors of a circle
You can define a colormap with 30 entries with, e.g., cmap = jet(30); and then draw a filled circle segment with code fr...

12 years ago | 0

Answered
Horizontally join two datasets of different sizes based on a common field
C = [A B(A(:,4)+1, :)];

12 years ago | 0

| accepted

Answered
variable=variable+i written something like variable+=i?
You can us something like this so that you don't have to do the very long index computation twice ind = % very long computa...

12 years ago | 0

Answered
How to show two figures of dynamic plots next to each other?
Use drawnow, pause, and specify the axis as in the following example for i = 1:2 subplot(1,2,1) axis([0 20 0 20])...

12 years ago | 0

| accepted

Answered
Sum elements in matrix if equal to value in another element
To sum the elements for i=1:size(ovec, 2) r(i) = sum(ovec(find(ovec(2:end,i)==ovec(1,i))+1, i)); end To count t...

12 years ago | 0

Load more