답변 있음
what is the error? Example?
Invalid syntax: function w=ket(;5) Inside the parentheses in a function definition should be a list of variable names. ";5" is...

3년 초과 전 | 0

답변 있음
Speed up plotting of multiple lines
Here's an idea: plot all the line segments of a given color together as one line object. That way you have 2745 lines instead of...

3년 초과 전 | 1

| 수락됨

답변 있음
Shuffle row order within every N rows in a matrix
Here's one way: I'll use a different matrix that makes it easier to see that the process works: data = repmat((1:8).'+(0:4),2,...

3년 초과 전 | 0

| 수락됨

답변 있음
why is my ea not being recognized?
ea is not defined because f(xl) * f(xu) >= 0 L = 1.25; E = 50000; I = 30000; w0 = 2.5; syms x f(x) = (w0/(120*E*I*L))*(-x^5+2...

3년 초과 전 | 0

답변 있음
Change half of my plotted shape a different color
x = [0 7 4 10 3 0 -3 -10 -4 -7]; y = [0 -5 4 9 9 16 9 9 4 -5]; I shift the order of the points in x and y so the top part of t...

3년 초과 전 | 0

답변 있음
How to omit/edit some elemental coordinates of a matrix
nye=10; nxe=20; dx=1.433; dy=1; % T=is the matrix including the centre points of the grid elements in the order of numbering...

3년 초과 전 | 1

답변 있음
Why are all the negative values in the matrix show as 0?
reltime is of class uint32, as shown here: load Foveal T = ans; class(T.reltime) An unsigned integer cannot be negative. If...

3년 초과 전 | 1

| 수락됨

답변 있음
How do I sum the values of sections of a table?
table_a = readtable('Data1.xlsx'); %Create the new vector, schoolyear for i = 1:height(table_a) if table_a.month(i)>=8 ...

3년 초과 전 | 1

답변 있음
error in .m file Line: 1 column: 1 invalid text character - line 1 all #
"#" is not used in any MATLAB statements or expressions, unless it's inside a string or character array. Use "%" for comments.

3년 초과 전 | 0

답변 있음
I made a logarithmic graph, and I want to add a continuous linear line that follows the equation y = x with x values from 1 to N.
Perhaps you mean: plotyy(1:n,factorial,1:n,x)

3년 초과 전 | 0

| 수락됨

답변 있음
Extract data points from a plot corresponding to the plot legend
Here's one way: f = openfig('ExampleData.fig'); lines = findall(f,'Type','line') line_props = cell(1,numel(lines)); for ii =...

3년 초과 전 | 0

답변 있음
How can I increase the size of matrices in cell arrays with each iteration of a loop?
A 10x10 cell array where each cell contains a 1x3 vector: C = repmat({[0 0 0]},10,10); Another 10x10 cell array where each cel...

3년 초과 전 | 1

| 수락됨

답변 있음
How to make a statement true for column 5-6?
'is there a better way to express "column 5-6"' Yes. You can use all(). Specifically, all(~isnan(__),2) where the 2 tells all(...

3년 초과 전 | 0

| 수락됨

답변 있음
How to split the last 4 elements in a column into a new column?
M = [5; 7; 2; 3; 6; 4; 9] You can't use a matrix, like you said, because the lengths of the two new column vectors is not the s...

3년 초과 전 | 0

| 수락됨

답변 있음
How to find the number of groups in another group?
M = [ 0 1 0 2 0 3 0 1 0 2 0 3 0 4 0 5 0 1 0 2 1 1 1 2 1 3 ...

3년 초과 전 | 0

| 수락됨

답변 있음
mesh or surf from x y z coordinates
Maybe something like this: load swarm data = vertcat(f{:}); data = cell2mat(data(:,1)) I = scatteredInterpolant(data(:,[1 2]...

3년 초과 전 | 1

답변 있음
How to select fields of a struct that contains certain string?
Maybe something along these lines: load table selected = []; for ii = 1:numel(trial_table) msg = {trial_table(ii).tria...

3년 초과 전 | 0

| 수락됨

답변 있음
Round values to specific number
"want something that will suit not only 100, but any desiried number" You can do round(val./d).*d where val is the original num...

3년 초과 전 | 1

| 수락됨

답변 있음
How to use if/then to create a vector using values from a table.
"is this the proper way to use if/then to create the schoolyear vector? Is there another way you would do it using if/then?" Lo...

3년 초과 전 | 0

| 수락됨

답변 있음
How to extract data from different strata?
data = xlsread('Dataset.xlsx') data(:,end) = fillmissing(data(:,end),'previous'); stratadata = splitapply(@(x){x},data(:,1:end...

3년 초과 전 | 0

답변 있음
Plotting graph for iterations of a for loop
First, let me run the code that calculates R: alpha_0 = [-1,-0.5,-0.1,0,0.1,0.5,1]; N = numel(alpha_0); R = nan(3,N); for a...

3년 초과 전 | 0

| 수락됨

답변 있음
How to combine data from 3 different arrays?
You can cat along the 4th dimension. Here's an example with random data: A = 10; B = 5; C = 8; G1 = 3; G2 = 6; G3 = 7; ...

3년 초과 전 | 0

| 수락됨

답변 있음
Plotting Graph using data stored in Properties (app.property) in App Designer
In Button2Pushed, x, y, and z should be app.x, app.y, app.z.

3년 초과 전 | 0

| 수락됨

답변 있음
plot function overwrites axes
If you haven't called hold on (or otherwise set the 'NextPlot' axes property, which is what hold does), then plot() does other t...

3년 초과 전 | 2

| 수락됨

답변 있음
Index exceeds the number of array elements. Index must not exceed 1.
The first time through the for loop, i is 2, so on the right-hand side of your equations you are accessing x1rec(1), x2rec(1), y...

3년 초과 전 | 0

| 수락됨

답변 있음
How can I draw contour lines in my problem ?
load Behi1 data = cell2mat(POFDE1); I = scatteredInterpolant(data(:,[1 2]),data(:,3)); [lat,lon] = meshgrid(unique(data(:,1))...

3년 초과 전 | 0

| 수락됨

답변 있음
matrix addition according to position vector
A=[1 3 5 7 9 11; 2 4 6 8 10 12]; b=[1 1 3 4 5 3]; Maybe something like this: C = zeros(size(A)); ub = unique(b); for ii...

3년 초과 전 | 1

| 수락됨

답변 있음
Find all row values from A matrix that match values of B matrix iterating thro rows from B matrix.
A = [3 6 9 12 2 4 7 4 5 3 1 10 5 6 8 9 10 11 ] B = [2 4 6 7 5 1 3 7 8 11 2 6] [ism,idx] = ...

3년 초과 전 | 0

| 수락됨

답변 있음
How can I extract a specific row from a table?
load DateToFind result = T(ismember(T.Date,Date_to_find),:) Then, if you want those temperatures in a matrix with 9 columns:...

3년 초과 전 | 1

| 수락됨

답변 있음
Graphic error with text annotations on app designer UIAxes
This is the expected default behavior; by default text objects have their Clipping property set to 'off'. The Clipping property ...

3년 초과 전 | 0

| 수락됨

더 보기