Respondida
How to save a new modified colormap ?
filename = 'C:\Me\colourmaps\myColourmap.mat'; save( filename, 'mycmap' ); Obviously filename is whatever you choose it ...

alrededor de 10 años hace | 0

Respondida
Listbox and Pushbutton in GUI
You should never call one uicontrol's callback from inside another one and certainly not passing down the hObject of the first o...

alrededor de 10 años hace | 1

| aceptada

Respondida
Subtracting two matrices of different size element by element
A(1:690) - B; will work without giving you errors, but quite why you would be in a situation where you want to subtract vec...

alrededor de 10 años hace | 0

| aceptada

Respondida
How to store values in a vector?
Vet = [5 9 repmat( [1+3, 3+4, 5+6], [1 3] )] will give you that specific vector. For a more general case it depends what y...

alrededor de 10 años hace | 0

Respondida
Filter a struct based on the field name.
names = fieldnames( myStruct ); subStr = 'f1_'; filteredStruct = rmfield( myStruct, names( find( cellfun( @isempty, strf...

alrededor de 10 años hace | 1

| aceptada

Respondida
Index exceeds matrix dimensions. Error in GUI
Are you actually passing the data into the subGUI when you launch it? e.g. subGUI( data );

alrededor de 10 años hace | 0

Resuelto


Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; and ...

alrededor de 10 años hace

Resuelto


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

alrededor de 10 años hace

Respondida
How to use the string of a variable as a new variable name?
Why would you ever need the name of a variable to change during an iteration? A variable name is just a handle to the variable,...

alrededor de 10 años hace | 1

Respondida
How to take the X smaller values of an array ?
[y,idx] = sort( x ); [~,idx2] = sort( idx(1:6) ); y = y( idx2 ); There may be a slightly more elegant way, but that d...

alrededor de 10 años hace | 1

| aceptada

Respondida
Passing the input argument to the class
If your class constructor takes arguments then just [a, b, c] = getdata( datalength, stringlength ); myObj = myClass( a,...

alrededor de 10 años hace | 0

| aceptada

Respondida
Cell contents assignment to a non-cell array object
main is declared as a struct so yes, you would get that error if you are trying to assign to it as though it is a cell array whi...

alrededor de 10 años hace | 0

Respondida
Meaning of ~isempty()
~ means NOT so *isempty* tells you if the vector is empty and *~isempty* tells you if the vector is _not_ empty.

alrededor de 10 años hace | 11

| aceptada

Respondida
how to load a file from different folder than our m. file?
Use the following syntax [FileName,PathName,~] = uigetfile(FilterSpec) then filename = fullfile( PathName, FileName...

alrededor de 10 años hace | 0

| aceptada

Respondida
Indices of a maximum value in a multidimensional matrix.
[maxVal, idx] = max( myMatrix(:) ); [x, y, z, w] = ind2sub( size( myMatrix ), idx );

alrededor de 10 años hace | 0

Respondida
How can i connect different points using straight line after plotting? is there any plotting tool?
How did you plot your points? The plot or line functions will, by default join points with a line.

alrededor de 10 años hace | 0

Respondida
Hardcoded Integers in C code generated by Matlab Coder
I would imagine they are 'epsilon' type parameters that are there to catch situations where you would end up dividing by zero or...

alrededor de 10 años hace | 0

Respondida
Parfor possible, though iterations depend
k is not involved in your parfor loop at all so each worker will just create its own List variable and doesn't care about the fa...

alrededor de 10 años hace | 1

Respondida
How to get an output from a callback function?
If you want to get into using object-oriented programming you can do something like this: Define a class derived from handle ...

alrededor de 10 años hace | 0

Respondida
About the Number property of figure function
'Number' is a read-only property. You can call: hFig = figure( 3 ); set( hFig, 'Position', [9 39 900 300], 'Name', 'Velo...

alrededor de 10 años hace | 2

| aceptada

Respondida
subscript indices must either be real positive integers or logicals( X_re(k_r)=XD(1,kd); can anyone help me why i am getting this error
At a glance N/d is 1024 / 28 which is not an integer so I imagine k_1=[k_1,kd+(hhh-1)*N/d]; produces non-integer values ...

alrededor de 10 años hace | 0

Respondida
Why is graphics object not being passed by reference in nested functions? (gobjects array loses values when function closes)
The array of GraphicsPlaceholder objects is not passed by reference, it is the objects themselves that would be passed by refere...

alrededor de 10 años hace | 0

| aceptada

Respondida
Calculate value based on previous row plus adjacent row
For that particular example: B = cumsum( A )';

alrededor de 10 años hace | 0

Respondida
Multiple element at same index
Use a cell array if you really want to do this i.e. y = { 0, -4, -2, [0 2 4], 0 }; Be aware though that using cell array...

alrededor de 10 años hace | 0

Respondida
Clear all workspace except variables use in GUI
Why don't you just use a function instead of a script? GUIs and scripts are not a great mix in general. Also, this is one of...

alrededor de 10 años hace | 0

| aceptada

Respondida
Axis equal plot in multiple axes GUI
The documentation for the axis equal command states that the following axes properties change: 'Sets DataAspectRatio ...

alrededor de 10 años hace | 0

Respondida
Radio button to ON-OFF figure visibility
Right click on your radio button group panel (you should put radio buttons in a button panel if they aren't already) and select ...

alrededor de 10 años hace | 0

Respondida
linkdata to structured data
You can set the 'XDataSource' and 'YDataSource' of the line object to e.g myStruct.a and myStruct.b (never call a struct 'struct...

alrededor de 10 años hace | 0

| aceptada

Respondida
Quantizing a grayscale image into 256 levels
In your case, assuming the values are still in the desired [0 255] range then just rounding and/or casting to integers is the be...

alrededor de 10 años hace | 0

Respondida
Given the variables how can i repeat a formula multiple times
For a start, lose the variables a_1, a_2, etc. Use an array, a, of all of them. Likewise with b and the same with the result i...

alrededor de 10 años hace | 0

Cargar más