Answered
How to define a new variable in a table, Part 2
Try this T = % you table Months = {'January', 'February', 'March', 'April', 'May', 'June', ... 'July', 'August', 'Septe...

23 jours ago | 0

| accepted

Answered
how to equalize row and column values in two matrices
Try this A = [0 3 0 4 0 0 0 0 8]; B = [6 5 8 2 1 7 3 9 4]; B(A==0) = 0; Result >> B B = ...

23 jours ago | 0

| accepted

Answered
Storing value in simulink
See Triggered Subsystems: https://www.mathworks.com/help/simulink/ug/triggered-subsystems.html. This link shows an example of th...

23 jours ago | 0

Answered
Converting python code to matlab code
See webwrite(): https://www.mathworks.com/help/matlab/ref/webwrite.html webread(): https://www.mathworks.com/help/matlab/ref/we...

23 jours ago | 1

| accepted

Answered
Plot a PWM Signal
Try this f = 490; A = 5; t = linspace(0, 0.01, 10000); y = A*square(2*pi*f*t); plot(t, y) xlabel('time'); ylabel('Amplitu...

23 jours ago | 0

Answered
How to get coordinates values X, Y, Z from the Meshed file in matlab?
Something like this TR = stlread('tristltext.stl'); x = TR.Points(:,1); y = TR.Points(:,2); z = TR.Points(:,3);

23 jours ago | 0

| accepted

Answered
Allow zooming to resize the axes and maintain axis equal
I guess you are trying to change the position of the axes() object, making it small such that the 'axis equal' effect remains on...

23 jours ago | 0

Answered
Conversion of Simulink Model to previous version
Check the attached file. However, the conversion showed these warnings. I guess there is some compatibility issue in the blocks ...

23 jours ago | 0

| accepted

Answered
model free control design
See PID control: https://www.mathworks.com/help/releases/R2020a/control/ref/pid.html, https://www.mathworks.com/help/releases/R2...

23 jours ago | 0

| accepted

Answered
Multiplying a 2-D array to a specific dimension of a 3-D matrix
Try something like this A = rand(100, 100, 72); B = rand(72, 3); A_C = mat2cell(A, ones(size(A,1),1), ones(size(A,2),1), si...

23 jours ago | 0

| accepted

Answered
please help me about Erfz
It appears you are using erfz() from this FEX package: https://www.mathworks.com/matlabcentral/fileexchange/3574-erfz. You need ...

23 jours ago | 0

Answered
Plot M by N by P matrix
See volshow(): https://www.mathworks.com/help/releases/R2020a/images/ref/volshow.html, especially check the Volume Viewer app: h...

23 jours ago | 0

| accepted

Answered
All Possible Matrix Permutations
Starting with char array '10' to create such matrices does not seems to be a good strategy. It is possible, but better to use nu...

23 jours ago | 1

| accepted

Answered
dsolve unable to find symbolic solution to second-order ODE
Since there is a nonlinear term in the ODE, I am not sure if a symbolic solution is possible. Following code shows how to get a ...

23 jours ago | 1

| accepted

Answered
Setting the colorbar ticks
I think it is better to use the correct number of colors so that the tick align with the colors map = jet(10); colormap(map) ...

24 jours ago | 0

Answered
Continuing Matrix involving a function to make very large
Try this syms e o n c=1; P = 1; G(n)=e./(2.*(P+0.5*(1i*n.*c)-(0.25*(n)^2))); N = 15; l_start = 5; u_start = 7; l_end =...

24 jours ago | 0

Answered
Heatmap image convert to data. Percentage of black to white.
rgb2gray() seems to work img = im2double(imread('image.png')); img_gray = rgb2gray(img); imshow(img_gray) However, the cor...

24 jours ago | 0

Answered
Implementation of summation Matlab
Try this a = 1:10; x = rand(1, 10); y = rand(1, 10); e = 1; z = sum(a(:).*cos((1:numel(a)).'*x(:).'*e)-y(:).', 'all')

24 jours ago | 0

| accepted

Answered
How to convert multiple tables into matrices
For dealing with multiple tables, it is best to create a cell array T = {myTable1, myTable2, myTable3}; Then you can function ...

24 jours ago | 0

| accepted

Answered
how to find the max element in each column and row and replace it with 1. If conflicting elements occur, look for the next max element.
Try this MP = [8 9 1; 3 5 7; 4 6 2]; MPouput = zeros(size(MP)); for i=1:size(MP,1) [~, idx] = max(MP(i, ...

24 jours ago | 0

Answered
How can I save a MATLAB workspace feature vector or matrix to as excel file in a specific directory ?
See these functions. writematrix: https://www.mathworks.com/help/releases/R2020a/matlab/ref/writematrix.html writetable: http...

24 jours ago | 0

| accepted

Answered
How can I define a function as the maximum of multiple functions
Create a function like this function y = maxFun(varargin) y = @(x) max(cell2mat(cellfun(@(fun) {fun(x(:))}, varargin)).');...

24 jours ago | 1

Answered
Help with the erfc function
This is not a correct MATLAB syntax erfc*(0.2/X3) Function should be called like this erfc(0.2/X3)

24 jours ago | 0

| accepted

Answered
Is it possible to extract the values with a vector of indices for each row without using the for statement from the matrix?
see sub2ind() A = [1, 2, 3; 4, 5, 6; 7, 8, 9; 10, 11, 12]; % reference matrix b = [2; 1; 1; 3]; % index for each row that I wa...

24 jours ago | 1

| accepted

Answered
How do I determine a good value for ki term in controller?
I suggest using the PID controller block: https://www.mathworks.com/help/releases/R2020a/simulink/slref/pidcontroller.html, whic...

24 jours ago | 0

Answered
differential equation with mixed linear and log derivatives - proper setting
Using chain-rule, we can write Therefore, the equation can be written as syms y(x) f eq = diff(log(y),x)*1/diff(log(x),x) +...

24 jours ago | 1

| accepted

Answered
How to read units on a 2nd row out of an Excel file?
Try this units = readtable('test.xlsx', 'Range', 'B2:D2', 'ReadVariableNames', false);

24 jours ago | 0

Answered
Linear-log regression model (curve fitting)
Try this x = [50;81;73;77;127;140;122;125;140;145;180;185;178;96;83;192;182;120;127]; y = [122;126;121;123;135;130;117;119;125...

24 jours ago | 0

| accepted

Answered
Axes changes while plotting during a for loop
Try adding this line at the end of your code axis tight For example for i=1:NumBuildPlates wblplot(B{i}); hold on ...

24 jours ago | 0

| accepted

Answered
How to change space between bars in a bar graph and the y-axis/edges of the graph?
data = [1, 2, 3; 1, 2, 3; 1, 2, 3]; labels = ["a", "b", "c"]; graph = bar(data,'stacked'); ylabel("Number of Publications")...

26 jours ago | 0

| accepted

Load more