Answered
3D Arrays finding an address in a element
doc ind2sub doc sub2ind will convert between n-dimensional subscripts and linear indices. In Matlab that is. Your declaratio...

7 years ago | 1

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

7 years ago | 1

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 2

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

7 years ago | 1

| accepted

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

7 years ago | 0

Answered
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

7 years ago | 2

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 2

| accepted

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

7 years ago | 1

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

Answered
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;

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

Load more