Pregunta


Why Do I Get This Error for This Non-scalar Structure?
I have this struct: A(1).B.C = 'a'; A(2).B.C = 'b'; A(3).B.C = 'a'; When I execute the code below, it works A...

alrededor de 7 años hace | 4 respuestas | 0

4

respuestas

Pregunta


How to Change Values of a Field by an Indexing Array?
Here’s my initial struct: A(1).B.C = 'a'; A(2).B.C = 'b'; A(3).B.C = 'a'; A(4).B.C = 'a'; I want to change the...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Access to Fields of a Non-scalar Struct?
How can I create the 4-by-1 cell array D from the struct A? A(1).B.C = 'a'; A(2).B.C = 'b'; A(3).B.C = 'c'; A(4).B...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How Does This Short Code Work?
How is D calculated? Could you explain the steps that MATLAB takes to calculate D? Is it only for logical values or can be ex...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Put an Arrays Elements in a Structure?
Is there any way to get as same a result as the code below without having that annoying for loop? A = [1; 1; 0; 0; 0; 0; 1]...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


A Message Box for a Nested Loop to Report Progress?
I have a nested loop that takes minutes to finish. I want to put a piece of code in the position of Statement2 to know about the...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Get the File Name and Store a File into a Struct While Using the Function uiopen?
I want to do two extra things while calling uiopen function. 1) How can I get the file that is opened? For example, I open A...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Keep Objects Organized while Maximizing a Figure?
Objects look fine on a figure until I maximize the figure. How can manage the position of objects when I maximize or generally c...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Manage the Order of Graphics Objects and Plots on an Axes Object?
How to manage to specify the order of p1,r1, and r2? For example, how can I put p1 between r1 and r2? f = figure; ...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


Easiest Way to Assign Graphics Objects to a 1-by-n Struct?
How to assign graphics objects to a 1-by-5 struct field? Is there an easier way than using a for loop and assign the values elem...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Put These Vectors in a Matrix?
A.B.G = [1 2 3]; A.C.G = [4 5 6]; A.D.G = [7 8 9]; A.E.G = [10 11 12]; A.F.G = [13 14 15]; so it will look li...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Use a For Loop to Dynamically Assign the Values of Struct Fields to a Matrix?
How to use a for loop to dynamically assign the values of fields C, D, and G to a matrix? if for loop is not possible, what e...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Exclude Some Fields While Using the Function structfun?
A.B.C = [1 2 3]; A.B.D = [3 4 5]; A.B.E = [6 7 8]; How to exclude A.B.E from the calculation and just get the sums o...

alrededor de 7 años hace | 2 respuestas | 0

2

respuestas

Pregunta


What Is the Definition of Scalar Structure?
What Is the Definition of Scalar Structure?

alrededor de 7 años hace | 1 respuesta | 1

1

respuesta

Pregunta


How to Assign Values from a Struct to a Matrix in a For Loop?
A.B.C = [1 2 3]; A.B.D = [3 4 5]; for k = 1:2 G(k, :) = A.B.C; G(k, :) = A.B.D; end G G returns: ...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Assign a Struct Field to a Matrix?
How can it assign field C and field D to the first and second rows of G, respectively? A.B.C = [1 2 3]; A.B.D = [3 4 5];...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Read this Code in English?
I am not an English-speaking person. How is the correct way to describe the code below with words? A.B.C = 1

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How MATLAB Reads an M File?
I have the two following functions in a MATLAB M File. Am I right that when you run an M File in Matlab, MATLAB ALWAYS executes ...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Expand an Existing Structure Array?
As a simple example, I create the struct B with one field: B.D = 1; How do I set parent struct A for the above-ment...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Assign These Values to This Struct?
As an example, I want to dynamically assign four output arguments of ttest function to four field of struct A, but I get the err...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


Why Isn’t One of Plots Shown?
I have some questions regarding the code below hax1 = axes('OuterPosition', [0 0 0.5 0.5]); hax2 = axes('OuterPositi...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Define a Default Input Argument for a Function?
How to define a default input argument for a function? I want to set a default input argument which will be replaced later by ne...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Directly Plot Spherical Coordinates?
Is there any way to plot spherical coordinates (theta, phi, rho) without first converting them into Cartesian coordinates?

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Create a Column Vector of a Field of a Struct?
How to create column vectors out of B (i.e., D = [10;20;30]) and C (i.e., E = [100;200;300])? A(1).B = 10; A(2).B = 20; ...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Access a Variable's Value in a Nested Function?
How Can I see the value of variable g in Command window and Workspace? function parentfcn(b) a = b+1 function chi...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Execute Something When a Graphics Object is Left-Clicked?
I want the red rectangle to turn green when I only “left-click” (not right-click or middle click) on it. What is the easiest sol...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


Hovering on an Graphics Object
I want the red rectangle to turn green while I'm hovering the mouse over it. How? hax = axes('XLim', [0 4], 'YLim', [0 4]);...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to Call Context Menu from Inside a Rectangle?
To call the context menu, I have to right-click exactly on the outline of the circle. Is there any way to call the rectangle whe...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Pregunta


How to access a field of a struct by indexing?
I have a 1-by-1 struct that possesses 3 fields named B, C, and D. Is there any way to call D by its index (i.e., D is the third ...

alrededor de 7 años hace | 2 respuestas | 2

2

respuestas

Pregunta


How to Suppress a Function?
When I run the code below, MATLAB runs it and I get the error “Not enough input arguments”. Isn’t there any way to tell MATLAB t...

alrededor de 7 años hace | 1 respuesta | 0

1

respuesta

Cargar más