Réponse apportée
How to extract RGB values of each pixel from an image?
r = im(:,:,1); g = im(:,:,2); b = im(:,:,3); assuming img is an RGB image of n*m*3 size, for any n, m

presque 9 ans il y a | 0

Réponse apportée
Passing data between UIFigures
app2.R = R; would work if you just want R, you don't need app1, but equally: app2.field3 = app.field3; for example ...

presque 9 ans il y a | 1

Réponse apportée
Run every element through a function and return a new array
doc rowfun using func = @(x) a*x + b - 1; should work for this provided a and b are already defined at the point yo...

presque 9 ans il y a | 4

| A accepté

Réponse apportée
how to stop seeing rationals on matlab
doc format gives you the options, which I assume you know to have chosen 'rat' in the first place, but we don't know what y...

presque 9 ans il y a | 0

Réponse apportée
Difference between columns, fixed the first column, in a matrix
res = max( 0, A(:,2:end,:) - A(:,1,:) ); _Note: This syntax only works from R2016b. For older syntax see Andrei Bobrov's a...

presque 9 ans il y a | 2

| A accepté

Réponse apportée
Problem related to locked axis.
Adding zoom reset after plotting the original will remember that as the current zoom which it will then zoom back out to...

presque 9 ans il y a | 0

Réponse apportée
Output of Function in Form of 'Color',[0 0.2 0.4]!
Well, you can do: colourArgs = clrs('blue') plot([1 2],[1 2],'x', colourArgs{:}); if you are willing to accept two li...

presque 9 ans il y a | 0

Réponse apportée
How to Change element values of an array with conditions?
A( A < 6 ) = A ( A < 6 ) + 10 Sadly Matlab doesn't have a neat += operator so you have to do the above rather ugly equivale...

presque 9 ans il y a | 2

| A accepté

Réponse apportée
How to change the double percent code section color?
It's under Preferences -> Colors -> Programming Tools -> Section display options

presque 9 ans il y a | 6

| A accepté

Réponse apportée
Getting rid of order of 10 axes labels
hAxes.YAxis.Exponent = 0; should work, off the top of my head. I don't have Matlab with me at the moment to check though.

presque 9 ans il y a | 0

| A accepté

Réponse apportée
zeros before a string using num2str
b = num2str(a,'0%3.4f')

presque 9 ans il y a | 0

Réponse apportée
Hi...can we create a variable "a" with double array type ? . Thank.
a = 7; is a variable 'a' of type double. Or even a = []; is also type double, but with empty contents.

presque 9 ans il y a | 1

Réponse apportée
How to create one colorbar for the colors of two pictures?
doc caxis

presque 9 ans il y a | 0

| A accepté

Réponse apportée
How to get information about toggle state of checkboxes in GUI?
You can fix that error by locating the checkbox in GUIDE, opening the Property Inspector for it and finding the 'CreateFcn' fiel...

presque 9 ans il y a | 0

Réponse apportée
How do I add 1 arrays elements into another array
a = [b c];

presque 9 ans il y a | 1

Réponse apportée
Function in class not working which normally works
Class functions must take the object of the class as their first argument unless they are static. You are missing this. ...

environ 9 ans il y a | 1

| A accepté

Réponse apportée
how to use string within a line of code
handles.( [ 'Num', num2str( button ) ] ) should work, although quite what you are doing with Button I can't work out f...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
What does mean(s(:)) do and the reason for using " : " for mean of a square matrix?
(:) reshapes the array to a column vector, as described in doc colon This is done when taking the mean of a 2d image as ...

environ 9 ans il y a | 1

Réponse apportée
How can I troubleshoot error in MATLAB with GCO?
"If this problem is reproducible, please submit a Service Request via: http://www.mathworks.com/support/contact_us/ A technic...

environ 9 ans il y a | 0

| A accepté

Réponse apportée
How to stop a for loop after the last 2 values of a 1d array are equal?
idx = find( diff( X ) == 0, 1 ); will tell you the location at which two values are equal. Then just loop as you normally ...

environ 9 ans il y a | 1

| A accepté

Réponse apportée
Is there any possible way of writing the following two-line code in one single line?
In a general case, no, you cannot index the result of a function call on a single line. This particular function just happens t...

environ 9 ans il y a | 1

| A accepté

Réponse apportée
How to access gscatter property and update data?
h = gscatter(...) gives you an array of 'Line' objects, which you can edit the properties of, including 'XData' and 'YData'...

environ 9 ans il y a | 1

| A accepté

Réponse apportée
Plotting the magnitude of the sum of complex exponentials
If you are using degrees you need to use doc cosd not 'cos', which expects radians as input. This is likely why you hav...

environ 9 ans il y a | 0

| A accepté

A résolu


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

environ 9 ans il y a

A résolu


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

environ 9 ans il y a

A résolu


Function Iterator
Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

environ 9 ans il y a

A résolu


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

environ 9 ans il y a

A résolu


Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

environ 9 ans il y a

A résolu


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

environ 9 ans il y a

A résolu


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

environ 9 ans il y a

Charger plus