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

mehr als 7 Jahre vor | 1

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

mehr als 7 Jahre vor | 1

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 2

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

Beantwortet
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

mehr als 7 Jahre vor | 2

| akzeptiert

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 2

| akzeptiert

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

mehr als 7 Jahre vor | 1

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

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

mehr als 7 Jahre vor | 0

| akzeptiert

Mehr laden