Respondida
Read inputs from GUI into a second master script
To put the summary of all this in an answer. Think what you are doing before just always putting any or all of the following ...

más de 8 años hace | 0

| aceptada

Respondida
Implicit indexing with structures - A question
You can just do it in two lines: stuff = [s.p]; result = [ stuff.x ]; (yes, I always have trouble naming random inter...

más de 8 años hace | 1

Respondida
how to horizontally concatenate two strings, being one a cell array and the other a num2str converted gpuarray?
If you define C as a cell array instead then, for example, this should work: C = { 'CELL:',',CELLA:',',CHAR:',',GCH4:',',GH...

más de 8 años hace | 0

Respondida
How to detect the changes in figure size to invoke a callback function?
The 'SizeChangedFcn' property of the figure can be used for this.

más de 8 años hace | 3

| aceptada

Respondida
Set image aspect ratio using imshow
doc daspect

más de 8 años hace | 0

| aceptada

Respondida
Removing rows from MyFolderInfo = dir('myfolder') before specific date
myDate = '10-Jul-2015'; myDateNum = datenum( myDate ); MyFolderInfo( [ MyFolderInfo.datenum ] < myDateNum ) = [];

más de 8 años hace | 0

| aceptada

Respondida
Using slice in a fuction and from command window
Almost certainly you had a variable in your workspace called slice which hides the function. The error message gives a big hint...

más de 8 años hace | 1

| aceptada

Respondida
GUIDE listbox context menu callback fails to update handles using guidata
You shouldn't really be calling a uicomponent's callback manually - it doesn't make sense. Factor out the actual functionality ...

más de 8 años hace | 0

| aceptada

Respondida
date time to datenum
What is wrong with the obvious res = datenum( yourData ); ?

más de 8 años hace | 0

| aceptada

Respondida
Rename images using uigetfile and cell array
Use the two output form of uigetfile: [filenames, pathname] = uigetfile({'*.jpg'}, 'MultiSelect', 'on', 'Please select the ...

más de 8 años hace | 0

| aceptada

Respondida
How can I start the y axis of my plot with 1 but keep increments at 5, 10, 15 and so on?
ylim( hAxes, [1 n] ); hAxes.YTick = [ 1 hAxes.YTick ]; should achieve this, though if your plot is dynamic with a changi...

más de 8 años hace | 0

Respondida
How to address the children of an axes (GUI)?
I assume, from the callback syntax, that this is a GUIDE GUI. If so then all your GUI components are stored on the handles stru...

más de 8 años hace | 0

| aceptada

Respondida
plot hold on in GUI
doc hold shows that you can call hold with an axes handle. You should always do this e.g. hold( handles.axes2, 'on' )...

más de 8 años hace | 11

| aceptada

Respondida
Replace values at certain positions (positions given in an array, as well as new values)
A(B) = C; should work if B are the locations and C the values, provided they are the same length and contain valid indices ...

más de 8 años hace | 0

| aceptada

Respondida
Colorbar is not representing my current colormap correctly
You have given true RGB values to scatter3 from mapping your data via the colourmap so the colourmap of the axes is still Parula...

más de 8 años hace | 0

| aceptada

Respondida
Arg max without using a loop
[ rowGrid, columnGrid ] = ndgrid( 1:size(A,1), 1:size(A,2) ); idx = sub2ind( size( B ), rowGrid, columnGrid, policy ); C...

más de 8 años hace | 0

| aceptada

Respondida
What's wrong with the code?
Simple use of the debugger or even just the command line would help you solve this. >> P{k}(:) ans = ...

más de 8 años hace | 0

Respondida
Does an object from a handle-inherited class compresses data?
Memory reported for handle classes tends to be totally un-useful. I don't know why, but it always shows up as 8 bytes, but that...

más de 8 años hace | 0

| aceptada

Respondida
Populating popup menu based on push button? (GUI)
You are missing the guidata( hObject, handles ) line from your pushbutton callback. <https://uk.mathworks.com/help/ma...

más de 8 años hace | 0

| aceptada

Respondida
I want to copy some data
a = [2 3 4; 6 2 3; 9 8 3]; b = repelem( a, 4, 1 ); If you are using R2015a or later. I haven't tested it for speed agai...

más de 8 años hace | 2

Respondida
Applying functions to each cell in a cell array
If you have multiple functions to perform a for loop would likely be simplest. The idea that for loops are very slow in Matlab ...

más de 8 años hace | 0

Respondida
How can I change the time axis unit in a spectrogram from minutes to seconds?
How are you creating the spectogram? Its axes will be whatever come from your input data, by default, but if you just create th...

más de 8 años hace | 0

Respondida
How to create a matrix, table or a cell where in odd columns variables from matrix A and in even columns variabls from matrix B will be stored?
C = reshape( [A; B], [5 48] ) will interleave columns of A and B. doesn't matter if they are numeric or cell arrays. Fo...

más de 8 años hace | 0

Respondida
How do I find the value of the cell from a particular row number
myArray{ 1, 2000 } if it is a cell array or myArray( 1, 2000 ) if it is a numeric array. Although when using a 1...

más de 8 años hace | 0

| aceptada

Respondida
Saving handles in callback function of button in dialog box opened by other button in GUI
Never pass handles around yourself to a callback function that you create a function handle to. Instead pass the handle of the ...

más de 8 años hace | 0

Respondida
App Designer: How to store multiple Checkbox values as array in property variable?
app.checkboxes = [app.1CheckBox, app.2CheckBox, app.3CheckBox]; in an initalisation function should work to store the check...

más de 8 años hace | 0

| aceptada

Respondida
Subscript indices must either be real positive integers or logicals.
Ee is just defined as a numeric scalar so I have no idea what these evaluate to, but unless it is 1 (in which case they are all ...

más de 8 años hace | 0

Respondida
How to access user input strings individually within a 'for' loop
my_str = cell(1,x); for ii=1:x my_str{ii} = input('Enter string: ', 's'); end Probably the pre-allocation is...

más de 8 años hace | 0

| aceptada

Respondida
textbox in an empty figure
How do we know? You haven't shown us any code! Just store the handle when you create it, then you don't need to look for it: ...

más de 8 años hace | 0

Respondida
Does MATLAB copy large input parameters or does it operate on pointers?
Matlab takes a copy of a matrix only when you make a change to that matrix, so even though it does not use pass by reference (ex...

más de 8 años hace | 0

| aceptada

Cargar más