Réponse apportée
How to draw concentric arcs in a 120 degree sector and the contour plots for mass flux of water spray in each concentric compartment ?
%% for polar plot theta = linspace(0,120,8); % angle division rho = [0.000959931, 0.051254502, 0.025132741, 0.099483767, 0...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How can I tell MATLAB to stay within coordinates of a rectangle?
You can use polygon/polyshape for room and obstacles. Then use "overlap" function to test if obstacles are inside the room. do...

environ 4 ans il y a | 0

Réponse apportée
How do I take complex number as an input and do operations on them in App Designer
% Get s using input function s = "2+3i"; x = str2double(s) For GUI components: % Assume that you have a uieditfield compon...

environ 4 ans il y a | 0

Réponse apportée
Plotting a line with an array of marker colours?
You can use scatter. x=[1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5]'; y=[1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Cummulative sum between NaN values
The result you gave above seems not correct. x=[ NaN 0.250000000000000 0 ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to display text in the same line after processing?
Try the following (not on line) s1 = 'Processing xyz123 file'; fprintf('%s', s1); % printing without change line pause(1) ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Dimension Disagree issue ?
Your code can run without issue as show below. Try "clear all;" before running the code. Or you can step through your code t...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
I can't run this function -nonlinear equation system
fun = @root; % Your function is not defined at [0,0] root([0 0]) % Try a different initial points x0 = [0.1,0.1]; x = fsolv...

environ 4 ans il y a | 0

Réponse apportée
How can I plot the second zoomed plot with legend colour ?
load tensile_matlab.mat % data variables stored in matrix X=[AR_e WQ_e AC_e FC_e WQS_e ACS_e FCS_e]; Y=[AR_s WQ_s AC_s FC_s ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How do I do unsigned comparsion between two n-bit vectors having 1s and 0s?
x = '1000000100000000000000000000000000000000000001010110001111000000' y = '0000000000000101011000111100000000000000000001010...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How do I do unsigned comparsion between two vectors having 1s and 0s?
x = '10000001000000000000000000000000' y = '00000000000001010110001111000000' % Convert the binary to decimal xd = bin2de...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
strange format of result(division operation)
Symbolic computation tries its best not to loose accuracy. You can convert it to a number at the end syms x f=-5e-6*((x).^2)+...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to get back the original matrix?
A=[1 2 3 2;4 1 2 3;3 4 3 2;2 4 1 1]; % Reordering the rows of A is reversible R=[1 3 4 2]; B=A(R,:); % Straightening up th...

environ 4 ans il y a | 1

Réponse apportée
How to get different patches (hatches) in my bar graph?
See the following: https://www.mathworks.com/matlabcentral/fileexchange/24021-hatch-fill-patterns-plus-color-invert

environ 4 ans il y a | 1

Réponse apportée
Labels above bar-plot
A = 1:10; B = randn(1, 10)*10; bar(A, B, 0.5); labels = compose('%.0f', B); text(A, B, labels, 'HorizontalAlignment','...

environ 4 ans il y a | 0

Réponse apportée
Solving the following equation without taking inverse.
In matlab, you can solve the linear system by mldivide or \ "doc mldivide" for detailed description. B= randn(4, 4) g = randn...

environ 4 ans il y a | 0

Réponse apportée
Fill missing data NaN
doc fillmissing fillmissing can be very powerful with various options.

environ 4 ans il y a | 0

Réponse apportée
How to output multiple types of binary files in one file
x = [ 1 7 13 2 8 14 3 9 15 4 10 16 5 11 17 6 12 18]; fid = fopen("test.bin", "w", "ieee-le"); for i=1:s...

environ 4 ans il y a | 0

Réponse apportée
Adding fading Background color (green --> yellow --> red) to plot(x,y)
xdata = [1.378 1.398 1.467 1.558 1.393 1.277 1.775 1.327]; ydata = [1.350 1.660 1.477 1.615 1.471 1.350 1.959 1.400]; figure(1...

environ 4 ans il y a | 0

Réponse apportée
How to use matlab audioread Plot the spectrum with frequency on the x-axis and dBA /dBC on the y-axis?
doc audioread % for reading audio file doc pwelch % for computing power spectral density

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Why do I receive this error "Invalid data type. Input arrays must be numeric or logical."?
It seems file to read the data using "readtable" as shown below. You can try "dbstop error" before running the code to locate w...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
how to put each element of vector as a label for the plot
x = randn(5, 7); A = [69; 70; 74; 77; 118; 103; 104]; % Just use the string array instead of cell chr_A = string(A); h = b...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
I have a signal which is quite noisy, I want to remove the noise from the signal, I did the smoothing but the results are still not good. The file is attached below
data= readmatrix("https://www.mathworks.com/matlabcentral/answers/uploaded_files/934649/DSO0001.CSV"); anum1 = data(:,1); anum...

environ 4 ans il y a | 0

Réponse apportée
How to check if all the data in the cell array are the same?
c = {100, 100, 100, 200} % cell array cm = cell2mat(c); same = all(cm == cm(1))

environ 4 ans il y a | 0

Réponse apportée
how to find the correct value of the matrix
x=[1 1 1 2 2 2 2 3 3 3]; d=0.1:0.1:1; into = zeros(size(x)); for ii=1:10 if ii<=3 into(ii)=x(ii)*(d(1)); ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Area under a PDF curve
For pdf that matlab supports, you can use cdf function to find the area under pdf. For your case zmax=10; m=0; sig=0.9; ...

environ 4 ans il y a | 0

Réponse apportée
print table using printf
a = array2table(rand(4,3)); % a simple table s = formattedDisplayText(a); % formatted display fid = fopen('test.csv', '...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
How to add maximum minimum points with respect to zero?
x1_min = -0.023 ; x1_max= 0.032; y1_min =-0.043; y1_max= 0.026; p1 = [x1_min, 0; 0, y1_min; x1_max, 0; 0, y1_max; x1_min, 0]; ...

plus de 4 ans il y a | 0

| A accepté

Réponse apportée
Is there a way to count the integers in a matrix that fall within a certain range?
a = randi(100, [3 10]); idx = a>=20 & a<=29; x = sum(a(idx))

plus de 4 ans il y a | 1

Réponse apportée
Making a Grantt chart, labeling individually based on vector
D = [1,1,5;2,1,3;3,4,6;4,3,6;5,1,3;6,6,11]; B = [3,6,1,2,4,5]; hBar = barh(D, 'stacked'); hBar(1).Visible='off'; hBar(3).Vis...

plus de 4 ans il y a | 1

Charger plus