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

más de 11 años hace | 0

| aceptada

Respondida
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); ...

más de 11 años hace | 1

| aceptada

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

más de 11 años hace | 0

Respondida
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(...

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 0

| aceptada

Respondida
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 ...

más de 11 años hace | 1

Respondida
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 ...

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 1

| aceptada

Respondida
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...

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 0

Respondida
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);

más de 11 años hace | 1

Respondida
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)

más de 11 años hace | 2

Respondida
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

más de 11 años hace | 0

Respondida
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...

más de 11 años hace | 1

| aceptada

Respondida
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); ...

más de 11 años hace | 1

Respondida
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');

más de 11 años hace | 1

Respondida
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...

más de 11 años hace | 0

Respondida
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.

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

Respondida
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 ...

más de 11 años hace | 1

| aceptada

Respondida
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...

más de 11 años hace | 0

| aceptada

Respondida
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....

más de 11 años hace | 0

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

más de 11 años hace | 0

Respondida
Getting a mean of only the numbers
Use nanmean

más de 11 años hace | 1

Respondida
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...

más de 11 años hace | 0

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

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

Respondida
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])...

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

Cargar más