Risposto
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...

oltre 2 anni fa | 0

| accettato

Risposto
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...

oltre 2 anni fa | 0

Risposto
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...

oltre 2 anni fa | 0

Risposto
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,...

oltre 2 anni fa | 0

| accettato

Risposto
Cummulative sum between NaN values
The result you gave above seems not correct. x=[ NaN 0.250000000000000 0 ...

oltre 2 anni fa | 0

| accettato

Risposto
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) ...

oltre 2 anni fa | 0

| accettato

Risposto
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...

oltre 2 anni fa | 0

| accettato

Risposto
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...

oltre 2 anni fa | 0

Risposto
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 ...

oltre 2 anni fa | 0

| accettato

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

oltre 2 anni fa | 0

| accettato

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

oltre 2 anni fa | 1

| accettato

Risposto
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)+...

oltre 2 anni fa | 0

| accettato

Risposto
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...

oltre 2 anni fa | 1

Risposto
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

oltre 2 anni fa | 1

Risposto
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','...

oltre 2 anni fa | 0

Risposto
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...

oltre 2 anni fa | 0

Risposto
Fill missing data NaN
doc fillmissing fillmissing can be very powerful with various options.

oltre 2 anni fa | 0

Risposto
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...

oltre 2 anni fa | 0

Risposto
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...

oltre 2 anni fa | 0

Risposto
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

oltre 2 anni fa | 1

| accettato

Risposto
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...

oltre 2 anni fa | 0

| accettato

Risposto
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...

oltre 2 anni fa | 0

| accettato

Risposto
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...

oltre 2 anni fa | 0

Risposto
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))

oltre 2 anni fa | 0

Risposto
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)); ...

oltre 2 anni fa | 0

| accettato

Risposto
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; ...

oltre 2 anni fa | 0

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

oltre 2 anni fa | 0

| accettato

Risposto
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]; ...

oltre 2 anni fa | 0

| accettato

Risposto
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))

oltre 2 anni fa | 1

Risposto
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...

oltre 2 anni fa | 1

Carica altro