Respondida
change color of bar plot
y = [12 22 23; 21 25 26; 24 18 19; 22 17 15]; h = bar(y,'stacked'); % capture the bar objects into variable 'h' legend({'Set #...

más de 3 años hace | 0

Respondida
Appdesigner, knob value
uiknob 'Value' is a numeric (https://www.mathworks.com/help/matlab/ref/matlab.ui.control.knob-properties.html), so both strcmp c...

más de 3 años hace | 1

| aceptada

Respondida
how can i define legend for bar3
bar3(randi(6000,[4,5]).*(1:5)); colors = [0 0.2 0.7; 0.8 0 0.1; 0 0.5 0; 0.5 0 0.5; 0 0.4 0.7]/0.8; colormap(colors) xticklab...

más de 3 años hace | 0

Respondida
find value with row and column
matrix = magic(4) value = 10 [row,column] = find(matrix == value)

más de 3 años hace | 0

Respondida
Sort columns of a table by the value corresponding
% I make a table of random data with 10 columns and 1 row, to represent your table C = num2cell(rand(1,10)); T = table(C{:},'V...

más de 3 años hace | 1

Respondida
Find repeated values of one column and assign the lowest value from the group of second columns
M = [12709.2240000000 -1.23920000000000 12709.2240000000 -1.23530000000000 12780.2225000000 -1.23530000000000 ...

más de 3 años hace | 0

| aceptada

Respondida
Finding the number of digits of the expected value of the codeword in extended Huffman Coding
Instead of this exp_value = exp_value + probVectorSuperSymbols(i) * length(extended_dict(2:i)); Do this exp_value = exp_value...

más de 3 años hace | 0

| aceptada

Respondida
Make the half note rest for two beats
Looks like this: rest2 = zeros(1,count*dr); should be this: rest2 = zeros(1,count*drest); Otherwise, rest2 is th...

más de 3 años hace | 0

| aceptada

Respondida
Toggle between temperature units for unit conversion
You need to take into account what the old unit was before it was changed. Fortunately, the ValueChangedFcn of a uidropdown prov...

más de 3 años hace | 0

| aceptada

Respondida
I need code for processing of table data
"we start from B2, if mod(B2 - B3) < 0.404 we delete A3B3 and continue to compare B2 with B(i), if B2 - B(i) >= 0.404 we leave t...

más de 3 años hace | 0

Respondida
Plotting a function where the x-axis is also a function
t=0:1:50; v=6.6524*(exp(0.0183993*t)-1); % p=2295000*v(1+0.2647*v); % ^^ missing operator (.*) p=2295000*v.*(1+0...

más de 3 años hace | 0

| aceptada

Respondida
Errors with imshow function
The image function creates an image object. The imshow function creates an image object and does other stuff to the axes, given...

más de 3 años hace | 0

Respondida
Find data after 'matched' regular expresion in a file
CatalogName = 'SAMPLE.txt'; Catalog = fileread(CatalogName) out = regexpi(Catalog,'NAME (\S+)','tokens'); out{:}

más de 3 años hace | 0

Respondida
How can I make a function from this few lines of codes?
% calling the function defined below filter_and_plot(-40:2:40) % defining the function function filter_and_plot(A) B = A...

más de 3 años hace | 0

Respondida
How can i vary the value of one parameter and plot them on same graph?
One way is to make the function ddems nested inside the function idtry and make k a variable in idtry's workspace; then k will b...

más de 3 años hace | 0

| aceptada

Respondida
Why there is error in using interp2 while assigning loaded data to the variable?
Try this: S = load("H2.mat"); data = S.data; h = interp2(data.P,data.T,data.H,235e+05,315);

más de 3 años hace | 0

| aceptada

Respondida
I can't find out the answer of conv x(n)=n/4(u(n)-u(n-6)) , h(n)=2[u(n+2)-u(n-3)] using stem function to make a plot.But i shows me conv error.How can I solve it ?
The code runs without error for me. Do you have a variable called conv? If so, that would prevent you from using the conv fun...

más de 3 años hace | 0

Respondida
How to plot z = x^2 * y
You have an extra space between "." and "*" Z = X.^2. * Y; % ^ space breaks up the .* operator That causes Z to be the...

más de 3 años hace | 0

Respondida
How to exclude/extract empty rows/columns in a table?
% read input file into table T T = readtable('test_file.txt'); % get a logical matrix saying whether each element of the tab...

más de 3 años hace | 0

Respondida
Calculate and plot linear amplitude versus linear frequency.
One thing is that you're calling plot with the inputs reversed. The syntax is plot(x,y); in this case, frequency (the variable f...

más de 3 años hace | 0

| aceptada

Respondida
Operator '*' is not supported for operands of type 'cell'.
Inflow_file = 'oppgave.xlsx'; T = readtable(Inflow_file, 'range', 'A1:A10956') inflow_s = str2double(T{:,1})

más de 3 años hace | 0

Respondida
Automatically identify two numbers within an matrix
matrix = readmatrix('matrix.txt'); matrix_1 = readmatrix('matrix_1.txt'); min_matrix = min(matrix(matrix >= 70)) max_matrix...

más de 3 años hace | 0

| aceptada

Respondida
how make a plot where both x and y are varying?
Like this? C = 1:10; % C changing B = 1; % B constant D = 1; A = B.*C.*D; subplot(2,1,1) plot(C,A) xlabel('C') yl...

más de 3 años hace | 0

| aceptada

Respondida
x and y ticks in pcolor plots
Set the axes property 'Layer' to 'top' in order to get the grid to show up on top of the pcolor surface. % a pcolor with EdgeCo...

más de 3 años hace | 2

| aceptada

Respondida
I have a code but it keep saying "invalid expression. when calling a function or indexing a variable, use parentheses. otherwise check for mismatched delimiters
It runs without error and shows a plot. Probably there's a syntax error in a nearby part of your code. prob = RollingDice() ...

más de 3 años hace | 0

Respondida
Create box chart with only Min Max Mean and Standard Deviation values
I don't know of a way to explicitly specify the min, max, mean and std of a data set in boxchart (or boxplot). (Note that those ...

más de 3 años hace | 0

Respondida
Is there a command that can check if a string is present in a certain array and output that same string?
I'm confused about what you want the output to be. L = {1, ["Spring", "Summer"]; 0, ["Winter", "Summer","Autumn"]}; ism = ce...

más de 3 años hace | 0

| aceptada

Respondida
Check/Uncheck box in app designer after opening and closing a secondary figure
See the attached modified app and m-file. See the comments in the code for descriptions of how it works. In addition to the beh...

más de 3 años hace | 0

| aceptada

Respondida
Multiplication of vectors in for loops
Possibly this: radius = rand(3,3); % contains 9 different values ycenter = 0; anglesRad = [0 1 2]; % I guess this is a 1-by-3...

más de 3 años hace | 0

| aceptada

Respondida
Plotting within for loop
for r = r(:,1) This redefines the variable r. Before the loop executes, r is a 3-by-7 matrix. After the loop, r will be a 3-by-...

más de 3 años hace | 0

Cargar más