Respondida
How to plot quiver with same scale on x and y axis?
Have you tried axis equal? % random quiver plot d = datenum(now()); x = d:1e-6:d+1e-4; y = randn(1,101); u = randn(1,101)...

más de 3 años hace | 0

| aceptada

Respondida
I need help setting a pushbutton in a GUI
% (you can specify all those properties at the same time as you create the % uicontrol) my_third_button = uicontrol( ... ...

más de 3 años hace | 0

| aceptada

Respondida
What indices of the original sequence are retained in the output of the decimate function?
From item #3 in the Algorithms section of the documentation for decimate: "In the resampled sequence (y), y(end) matches x(end)...

más de 3 años hace | 0

| aceptada

Respondida
How to show function's result from command window to a "text area or edit field" in app designer ??
function get_powerButtonPushed(app, event) app.PowerTextArea.Value = app.obj.get_power(1); end Note that this is the call...

más de 3 años hace | 0

| aceptada

Respondida
Read text file, identify variables and rewrite some of the variables
% read the file into a char vector: fid = fopen('Initial.txt'); data = fread(fid,'*char').'; fclose(fid); disp(data); % spl...

más de 3 años hace | 1

| aceptada

Respondida
Search for the Y coordinate knowing the X coordinate
coord_x = A(:,1); coord_y = A(:,2); [X,idx] = max(coord_x); Y = coord_y(idx);

más de 3 años hace | 1

| aceptada

Respondida
Padding a cell array?
Maybe something like this: C = {1 2 3 4}; C_new = cell(1,2*numel(C)); C_new(1:2:end) = C

más de 3 años hace | 0

| aceptada

Respondida
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2.
This line, which is a few lines above the line with the error: vr(ii,jj) = lamb/(2.*pi*r); makes vr a 1-by-2 vector when it is...

más de 3 años hace | 0

Respondida
Finding min and max values in a structure
"a 1x1 structure with multiple fields, each field consisting of a cell of numbers" yourStruct.a={1,2}; yourStruct.b={3 4; ...

más de 3 años hace | 0

Respondida
How to index a matrix to make it from a vector, taking some elements from the vector and put them in a new row?
Here's one way to do it: pilots4356 = 43:56; %vector N = numel(pilots4356)-2; matrix4356 = zeros(N,N+2); %matrix size % ...

más de 3 años hace | 0

| aceptada

Respondida
Sorting a matrix column to match another column
t = table( ... ["a";"c";"e";"g"],["b";"d";"f";"h"],[44; 16; 03; 63]) d = [63; 16; 44; 3]; [~,idx] = ismember(d,t{:,3});...

más de 3 años hace | 1

Respondida
How i can convert a text into binary and then split the binary form, finally convert each partition into ASCII code?
You can replace your for loop with this, which will be faster because it calls dec2bin one time on the entire text instead of on...

más de 3 años hace | 0

| aceptada

Respondida
how can i convert table of string to a single row vector
Something like this? % making a table like yours: transcript = table(["the"; "discreet"; "forier"; "transform"; "of"],[0.99085...

más de 3 años hace | 0

Respondida
I need help randomizing a triangle
It is not enough to generate a new random point_A, point_B, and point_C on each iteration. You need to make those points take ef...

más de 3 años hace | 0

| aceptada

Respondida
How can I create a bar plot like the following figure in Matlab? Any help? Thank you.
See bar: <https://www.mathworks.com/help/matlab/ref/bar.html>

más de 3 años hace | 0

Respondida
Convert equation into code
c1 = 2; c2 = 4; c3 = 5; J = 10:10:50; O = zeros(size(J)); O(1) = J(1); for n = 1:numel(O)-1 O(n+1...

más de 3 años hace | 0

Respondida
Why am I getting this error? "Array indices must be positive integers or logical values".
On that line, everything inside the outermost parentheses on the right-hand side is an index into P0: P_twitch_short(i) = P0(0....

más de 3 años hace | 1

| aceptada

Respondida
How can I enter a matrix into GUI?
You can use a multi-line edit box, see: https://www.mathworks.com/matlabcentral/answers/94590-how-do-i-enter-and-evaluate-multip...

más de 3 años hace | 0

Respondida
Insufficient number of outputs from right hand side of equal sign to satisfy assignment.
CEST = [2022,10, 11, 2, 0, 0]; UTC = CEST-[0, 0, 0, 2, 0, 0]; This is what you intend to do: yyyy = UTC(1); mm = UTC(2); dd...

más de 3 años hace | 0

| aceptada

Respondida
how to get a new array with some values ​​from an old array
B = (A >= 20) % same as B = A >= 20, i.e., without parentheses makes B a matrix of logicals, the same size as A; the elements o...

más de 3 años hace | 0

| aceptada

Respondida
Plotting multiple current loops for magnetic field
The problem is that Rx, Ry, and Rz are overwritten in the outer for loop: % before the loop, calculate Rx, Ry, Rz: Rz = r.*cos...

más de 3 años hace | 0

| aceptada

Respondida
Extracting numbers including 0 at the start of the number
x = '02290234567'; x = x - '0'

más de 3 años hace | 0

Respondida
How can I select a part of a matrix ?
B = [1 0.3 2 0.6 3 0.5 4 0.7 5 0.2 6 0.5 7 0.4 8 0.5]; idx ...

más de 3 años hace | 2

| aceptada

Respondida
How to store data without deleting previous one
mask is a variable that only exists in the workspace of the DRAW function. In other words, each time DRAW is executed, a new mas...

más de 3 años hace | 0

| aceptada

Respondida
The size of X must match the size of Z or the number of columns of Z.
The error happens because T is a 102-by-102 matrix but X and Y only have 101 elements: % % geometry of domain Nx = 102; Ny = ...

más de 3 años hace | 0

Respondida
How i can convert binary elements of cell into decimal elements and store the results in array?
MB = { '0101' '0011' '0111' '0100' '0110' '0101' '0110' '0111' '0110' '1111'}; D = bin2dec(MB)

más de 3 años hace | 1

| aceptada

Respondida
Reshaping a cell array
C = {{[1 2 3]} {[4 5 6 7]} {[8 9]}} C = [C{:}]

más de 3 años hace | 0

| aceptada

Respondida
How can I find numeric values (stored as strings) in table of strings and convert them to double?
"Is there a possibility to find numeric values that are stored as string/char within a cell array and to convert only them?" Ye...

más de 3 años hace | 1

| aceptada

Respondida
How to plot a smooth curve while data point order is messed up
Some random data: data = randn(10,2) Sort on the first column: [~,idx] = sort(data(:,1)); data = data(idx,:) Then plot with...

más de 3 años hace | 1

| aceptada

Respondida
Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2
The error message will tell you which line the error occurred on, but I think it's this one: meansData_1(i,:)=mean(storeall...

más de 3 años hace | 1

| aceptada

Cargar más