Respondida
Set color to 'none' instead of white in 'heatmap'
Unfortunately 'none' is not a valid value for 'MissingDataColor', and I cannot find any way to set alpha values in heatmaps. Wo...

casi 6 años hace | 0

Respondida
(app designer) Callback for ROIMoved event does not work
Thomas, When setting up the listener, use addlistener(ROI, 'ROIMoved', @app.allevents) Then, when defining allevents, use fu...

casi 6 años hace | 5

| aceptada

Respondida
Dimensional error while running the code from matlab documentation
This code should run without error in R2016b and later due to implicit expansion, as t is a row vector and [50 150 200]' is a co...

casi 6 años hace | 0

| aceptada

Respondida
Merge cell that has common element
I'm not sure if this is the best way to do it, but I believe it will work. It starts by setting A_new to A. It then loops throu...

casi 6 años hace | 0

| aceptada

Respondida
Generating arbitrary colored tick labels
Is TeX an option for you? n=10; plot(1:n); labels = cell(n,1); for i=1:n labels{i} = sprintf('\\color[rgb]{%f, %f, %f}%...

casi 6 años hace | 1

| aceptada

Respondida
How to check whether a specific variable is empty or not in table type
T_data(~cellfun(@isempty, T.ls_max_tone),:) This will return a table containing only the rows where ls_max_tone is not empty.

casi 6 años hace | 0

| aceptada

Respondida
There is no InnerPosition property on the matlab.graphics.layout.TiledChartLayout class.
It looks like a handful of properties for TiledChartLayout objects, including 'Position', 'InnerPosition', and 'OuterPosition', ...

casi 6 años hace | 1

Respondida
How to get linprog to not ignore x0 R2019a
This suggests the initial condition is ignored unless you use the active-set algorithm. This says active-set was removed for li...

casi 6 años hace | 0

Respondida
find elements which has minmum and maximum probability in an array
A = [ 1,2,3,4,5,6,7]; P = [ 0.01,0.01,0.25,0.2,0.25,0.09,0.19]; minprob = A(P==min(P)) maxprob = A(P==max(P)) minprob = ...

casi 6 años hace | 1

| aceptada

Respondida
How can I make this code more efficient so it will run faster?
Since the order of the steps doesn't matter, how about this? X = [1000, 2500, 10000, 25000, 100000, 1000000]; for k = 1:length...

casi 6 años hace | 1

| aceptada

Respondida
Conditional replacement of array values from another array
Do you need a loop? If you know there are exactly as many 500s in A as there are values in B: A(A==500) = B; If there may be ...

casi 6 años hace | 1

Respondida
find maximum value for each year in a 2 columns array
Try this: [G, y] = findgroups(input(:,1)); output = [y splitapply(@max, input(:,2), G)];

casi 6 años hace | 1

| aceptada

Respondida
Create a vector from components of old vectors
For a matrix A such as A = rand(3,5); this should work: v = [A(1,:) A(:,3)']

casi 6 años hace | 1

| aceptada

Respondida
print values in one matrix to another
Let me know if this works: length = [connectivity, zeros(total_elements, 4)]; for i = 1:total_elements length(i, [4 6]) =...

casi 6 años hace | 0

| aceptada

Respondida
Outputting cell vectors that contain specific information help?
You can use the colon operator to generate a character vector containing each lower case letter in the alphabet: >> 'a':'z' an...

casi 6 años hace | 0

| aceptada

Respondida
Matlab Code for the Gauss Legendre Quadrature
Have your vectors of weights be the same size as your vectors of locations, ordered so that corresponding weights and locations ...

casi 6 años hace | 2

| aceptada

Respondida
how do i give the user the option to stop making an input? while loops program.
Check the value of grade immediately after the user inputs it, and only update count and x if the loop should continue: x = [];...

casi 6 años hace | 0

Respondida
8 digit double array to 1 digit double array
How about H_conv = num2str(H)-'0'

casi 6 años hace | 0

Respondida
index exceeds the number of array
Ah, ok. You flip between treating S1 as a vector containing the different stock prices (which it is in your new code) and as a s...

casi 6 años hace | 0

| aceptada

Respondida
(Strain vs Stress Curve) to (Stress Vs Strain Curve) Switch My X-axis into Y-axis in my plot
plot (strain.normal,length(strain.normal),'b'); In this line, length(strain.normal) is a scalar, so nothing is plotted, simil...

casi 6 años hace | 1

| aceptada

Respondida
Trying to extract numbers between bounds and counting them
Currently, your for loop only runs once, during which time k is equal to the entirety of x. By using for k = x(:,1)' or just ...

casi 6 años hace | 0

Respondida
multiple linear regression check
All of the loops can be avoided. If you have something like b=1:10; for i=1:numel(b) a(i)=2*b(i)+3; end you can always ...

casi 6 años hace | 0

| aceptada

Respondida
Formating a table with unequal rows
How about this? load('matlab.mat'); C = unique([OutnbEmployees1.AlgPhrase; OutnbEmployees2.IrqPhrase; OutnbEmployees3.TunPhras...

casi 6 años hace | 0

Respondida
Modifying a Row Vector to Pair up Numbers
How about this? S1 = [ 4, 6, 3, 5, 1 ]; S2 = [ 3, 3, 1 ]; S3 = [ 2, 4, 7, 1 ]; C = {S1,S2,S3}; C2 = cellfun(@(s) 10*s(1:end-1...

casi 6 años hace | 0

Respondida
Joining a column from one table to another by id
If you know each ID in A is included in B exactly once, I believe this should work: A = [A rowfun(@(rn) B.N(strcmp(B.ID,rn)), A...

casi 6 años hace | 0

Respondida
How to change certain values of a column in a table depending on a certain time range ?
Try this: totalaggregated{TR,{'Total'}} = 0.75*totalaggregated{TR,{'Total'}};

casi 6 años hace | 0

| aceptada

Respondida
Always show the error Function definitions in a script must appear at the end of the file.
When you create a script in MATLAB, all function definitions need to be at the end of the file. function Dp=fun1(t,p) y=p(1);z...

casi 6 años hace | 0

Respondida
Find repeated pairs of two variables
How about this? % examples weight = randi([70 74], 10, 1); height = randi([5 7], 10, 1); [~,i] = unique(findgroups(height,...

casi 6 años hace | 0

| aceptada

Respondida
Invalid use of operator. "*"
Make sure the period is adjacent to the asterisk: y = cos(20*x).* exp(x.^2);

casi 6 años hace | 2

| aceptada

Respondida
How to set UIAxes min and max lim for plot in app designer ?
Use ylim(ax, [minlim,maxlim]) instead.

casi 6 años hace | 0

Cargar más