Respondida
How do I change the x and y coordinates in a colormap?
doc imagesc shows that the first two arguments can be the x data and the y data if you use the 3-argument syntax or property-va...

alrededor de 7 años hace | 1

Respondida
Simplyfing code by removing from script and adding to function
This code is the same in both cases so should definitely go inside a function, though you may wish to pass stroke in as an input...

alrededor de 7 años hace | 0

Respondida
if statement for colour coding data
Create a mask: greenDataIdx = Depth <= 11.9; plot( Lat( greenDataIdx ), Long( greenDataIdx ), 'g*' ) hold on ... Then plo...

alrededor de 7 años hace | 0

| aceptada

Respondida
How can one remove y-axis ticks on imagesc but keep labels?
hAxes.YAxis.TickLength = [0 0]; Following on from what you said in your own question. That seems to work. Assuming you are in...

alrededor de 7 años hace | 1

| aceptada

Respondida
Error using * Inner matrix dimensions must agree.
Unless you meant matrix multiplication, in which case you likely need to transpose one side of the * then what you need is .* fo...

alrededor de 7 años hace | 1

| aceptada

Respondida
How do I combine these answers into a matrix?
diff(A) will do this.

alrededor de 7 años hace | 0

| aceptada

Respondida
In my gui3 , i want to break loop when i close the gui figure window
isgraphics( handles.figure1 ) will tell you if the figure is still active or has been deleted.

alrededor de 7 años hace | 2

Respondida
Get handles from GUI img
Add handles.imgRGB = imgRGB guidata(h, handles) in your above function, then if you get handles in your other function you ...

alrededor de 7 años hace | 1

| aceptada

Respondida
Editing colors in a colormap
How do you have your colourmap currently? If you have it as an e.g. 256x3 matrix of colours then you can just set e.g. myColou...

alrededor de 7 años hace | 0

Respondida
How to change a sign of elements in a matrix for each coulmn separatly ?
vny = v; vny( 2:2:end) = -vny( 2:2:end); should work

alrededor de 7 años hace | 2

| aceptada

Respondida
Mean/average of a variable
M = mean( squeeze( P(a,:,:) ) should give what you want

alrededor de 7 años hace | 0

Respondida
Use of handle in matlab 2013b
function h = counter persistent x if isempty( x ) x=0; end h=addone; function y=addone x=x+1; y=x; ...

alrededor de 7 años hace | 0

Respondida
how to return values from .mlapp to the .m caller
An App designer UI is just a class. You can add functions and properties to this however you wish and access these from the sco...

alrededor de 7 años hace | 2

| aceptada

Respondida
[DISCONTINUED] MATLAB Answers Wish-list #4 (and bug reports)
One thing I would find useful is some kind of question activity history. This may have been mentioned already in this thread, b...

alrededor de 7 años hace | 1

Respondida
Print subfunction names to text file
m = methods( 'master' ) will give you the information you need. Then you can tag the class name on the front or whatever else ...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to dynamically update a static text box depending on number of checkboxes selected.
One method: Add this to your OpeningFcn before the guidata call handles.hCheckboxes = [ handles.checkbox1, handles.checkbox2...

alrededor de 7 años hace | 0

| aceptada

Respondida
how to conver double data type into signed binary in matlab?
A = A = [-1.9, 1.7, -9, 12 13 -90 0]' result = sign( A ); will give you -1, 0 or 1 depending on the sign of your data. Here...

alrededor de 7 años hace | 0

Respondida
Count number of repeated element before next different number in array?
runs = diff( [0 find( diff( A ) ) numel( A )] ) if A(1) == 1 OnesRepeated = runs( 1:2:end ); else OnesRepeated = runs(...

alrededor de 7 años hace | 0

Respondida
Ηow to properly measure the execution time of a piece of code
doc timeit is the best way to get simple timings from a piece of cide. It deals with running multiple times and averaging as w...

alrededor de 7 años hace | 0

Respondida
Link corresponding elements of two matrices of the same dimension
I never use tables myself, but something like the following should work fine: t = table( randi(10, 20, 1 ), randi(10, 20, 1 ) )...

alrededor de 7 años hace | 0

Respondida
Stretch Yaxis to increase gap between data points in scatter plot
Your y position is just specified as being k, which increments in steps of 1. Just change to using something else, e.g. 3*k in:...

alrededor de 7 años hace | 0

| aceptada

Respondida
Accessing variable in struct using string
behaviours{1,1}.( ped ) should work

alrededor de 7 años hace | 1

| aceptada

Respondida
How to find first letter of my string is alphabetic??
This works, I think, but I'm sure there are far neater approaches that people will come up with!! str = "20inputsignal"; ch = ...

alrededor de 7 años hace | 0

Respondida
How to add a legend to a graph with multiple lines
You can pass labels to the legend function in a cell array so you can create that dynamically as e.g. legend( arrayfun( @num2st...

alrededor de 7 años hace | 0

Respondida
How to transform a matrix into a 3D array (tensor) ?
permute( reshape( reshape( B', 3, 4 )', [2 2 3] ), [2 1 3] ) gives the answer you want, but I'm sure there is a tidier way that...

alrededor de 7 años hace | 0

Respondida
Detect if variable is a GUI container
I tend to validate most of my function inputs and often write classes that involve plotting something (either on a supplied axes...

alrededor de 7 años hace | 1

| aceptada

Respondida
How to plot coördinates in a 3D space?
doc plot3

más de 7 años hace | 0

| aceptada

Respondida
Matrix manipulation problem under MATLAB
A = [0 2 9; 5 7 3; 4 6 1]; C = [1 2 3; 4 5 6; 7 8 9]; B = zeros(6); B(1:3,1:3) = A; B(4:6,4:6) = C;

más de 7 años hace | 0

| aceptada

Respondida
Update UI table data in appdesigner?
Change the columnEditable property of the uitable to be true for the columns you want to edit and false for the others.

más de 7 años hace | 0

| aceptada

Respondida
How to increase number of colors in colorbar, and how to draw boundaries of regions?
doc colormap allows you to change the colourmap that is used. You can either choose from already created Matlab colourmaps or ...

más de 7 años hace | 0

Cargar más