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

plus de 8 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...

plus de 8 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...

plus de 8 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...

plus de 8 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...

plus de 8 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...

plus de 8 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...

plus de 8 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

plus de 8 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.

plus de 8 ans il y a | 0

| A accepté

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

plus de 8 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.

plus de 8 ans il y a | 1

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

plus de 8 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...

plus de 8 ans il y a | 0

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

plus de 8 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. ...

plus de 8 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...

plus de 8 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 ...

plus de 8 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...

plus de 8 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 ...

plus de 8 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...

plus de 8 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'...

plus de 8 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...

plus de 8 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".

plus de 8 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...

plus de 8 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...

plus de 8 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...

plus de 8 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...

plus de 8 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...

plus de 8 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...

plus de 8 ans il y a

Réponse apportée
How to restrict a background from changing?
Plot functions and hold and all other similar functions take an axes handle as their first argument. Use it! So many people se...

plus de 8 ans il y a | 0

Charger plus