Réponse apportée
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)...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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( ... ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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)...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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);

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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; ...

plus de 3 ans il y a | 0

Réponse apportée
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 % ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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});...

plus de 3 ans il y a | 1

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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>

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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....

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Extracting numbers including 0 at the start of the number
x = '02290234567'; x = x - '0'

presque 4 ans il y a | 0

Réponse apportée
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 ...

presque 4 ans il y a | 2

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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 = ...

presque 4 ans il y a | 0

Réponse apportée
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)

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Reshaping a cell array
C = {{[1 2 3]} {[4 5 6 7]} {[8 9]}} C = [C{:}]

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 1

| A accepté

Charger plus