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

fast 12 Jahre vor | 0

| akzeptiert

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

fast 12 Jahre vor | 1

| akzeptiert

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

fast 12 Jahre vor | 0

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

fast 12 Jahre vor | 0

| akzeptiert

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

fast 12 Jahre vor | 0

| akzeptiert

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

fast 12 Jahre vor | 1

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

fast 12 Jahre vor | 0

| akzeptiert

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

fast 12 Jahre vor | 1

| akzeptiert

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

fast 12 Jahre vor | 0

| akzeptiert

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

fast 12 Jahre vor | 0

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

fast 12 Jahre vor | 1

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

fast 12 Jahre vor | 2

Beantwortet
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

fast 12 Jahre vor | 0

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

fast 12 Jahre vor | 1

| akzeptiert

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

fast 12 Jahre vor | 1

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

fast 12 Jahre vor | 1

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

fast 12 Jahre vor | 0

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

fast 12 Jahre vor | 0

| akzeptiert

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

fast 12 Jahre vor | 0

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

fast 12 Jahre vor | 1

| akzeptiert

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

fast 12 Jahre vor | 0

| akzeptiert

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

fast 12 Jahre vor | 0

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

fast 12 Jahre vor | 0

Beantwortet
Getting a mean of only the numbers
Use nanmean

etwa 12 Jahre vor | 1

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

etwa 12 Jahre vor | 0

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

etwa 12 Jahre vor | 0

| akzeptiert

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

etwa 12 Jahre vor | 0

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

etwa 12 Jahre vor | 0

| akzeptiert

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

etwa 12 Jahre vor | 0

Mehr laden