Respondida
In one loop, sort table and save each matrix in different text files, How?
data = readtable('sampleU.xlsx') [uZ,~,jj] = unique(data.Z); for ii = 1:numel(uZ) % pick a file name for the sub-table (n...

más de 3 años hace | 0

| aceptada

Respondida
Last graph is plotted with no data points(figure 3) dont know why
Use ./ instead of / Signal_Attenuation = (signal_strength_-30) ./ d

más de 3 años hace | 0

Respondida
How can I use interp1 to interpolate the last row of a matrix?
Here's my guess at what you mean: A = [1,2,3;4,5,6;7,8,9;10,11,12] N = size(A,1); A(N+1,:) = interp1(1:N,A,N+1,'linear','extr...

más de 3 años hace | 1

| aceptada

Respondida
How to print values on different row in App designer Table
Try it like this: % add a row to app.UITable.Data: app.UITable.Data = [app.UITable.Data; {predicted pred1}]; % add another ...

más de 3 años hace | 0

| aceptada

Respondida
working with a vector
% a column vector: x = [1;4;5;7;10] % one way: diff(x) % another way: x(2:end)-x(1:end-1)

más de 3 años hace | 0

| aceptada

Respondida
Receiving error when trying to obtain multiple inputs
It's a good idea to share the complete error message you received, including the line number and the text of the line the error ...

más de 3 años hace | 1

| aceptada

Respondida
App Designer dispaly values in Text area and Guage
% textarea app.BText.Value = num2str(B); % assuming BText is the name of your textarea % gauge app.AGauge.Value = A; Ref...

más de 3 años hace | 0

| aceptada

Respondida
i am not getting what is the problem with it
function good = find_good_hotels(hotels,ratings,cutoff) if ratings>=cutoff Ridx=find(ratings) good=hotels(Ridx) else...

más de 3 años hace | 0

Respondida
I'm trying to create a 57x1 matrix out of the con_data 57x4 matrix/variable, and then plot that matrix from the userinput. But avg_energy is an unrecognised function/variable
Seems like con_data (rather than avg_energy) would be an input to choose_plot, since choose_plot calculates avg_energy from con_...

más de 3 años hace | 0

| aceptada

Respondida
Error using plot: Unrecognized property LineWidth for class Line
Use 'LineWidth' instead of 'LineWidth ' with a space on the end. plot(th,Ias, 'k− ',th,Ibs, 'b−− ',th,Ics, 'r: ','LineWidth ',2...

más de 3 años hace | 1

| aceptada

Respondida
Pythagorean theorem with matrix
function C = pita(AB) A = AB(:,1); B = AB(:,2); C = sqrt(A.^2+B.^2); % (no transpose) end

más de 3 años hace | 0

| aceptada

Respondida
Is it possible to use a script as a callback or ButtonDownFcn in uicontrol?
% Add Proceed Button To Figure pButton = uicontrol(CIW,'Style','pushbutton','Units','pixels',... 'FontName...

más de 3 años hace | 1

| aceptada

Respondida
Error using matlab.graphics.axis.Axes/set
First, thank you for including data and runnable code. Second, it appears to run fine here (see below). Try updating your peak...

más de 3 años hace | 0

| aceptada

Respondida
Converting a 3D matrix to several 2D matrices
max_iteration=5; a=zeros(10,48); b=zeros(10,48); s = zeros(10,48,max_iteration); for k=1:max_iteration % presumably a a...

más de 3 años hace | 0

| aceptada

Respondida
Nested loop for matrix
clc clear all; % ED = readmatrix("Data filteration1.xlsx"); ki = 0.0042; %%current temp coeff Ns=72; %%72cells i...

más de 3 años hace | 0

| aceptada

Respondida
Live Editor: Brace indexing changes Table to Struct
Your table is A, but all of the code we can see here involves A.all. Shouldn't you be doing, for instance: number=sum(A{i,5:end...

más de 3 años hace | 0

Respondida
Removing Variables From a Cell Array
"for the array Y it wont remove the final string" That's because changing the loop iterator (in this case the variable ii) does...

más de 3 años hace | 0

Respondida
I want to change the name of the three box chart to other three names
xticklabels({'A' 'B' 'C'}) % whatever labels you want

más de 3 años hace | 0

| aceptada

Respondida
Functions to encode a function
Not sure exactly what you mean, but [h g f e d c b a] encodes the function f(x) (for use in polyval, for instance). a=3; b=0; c...

más de 3 años hace | 0

Respondida
Define the values in each row of a 100x150 matrix as row numbers
One way: repmat((1:100).',1,150) Another way: (1:100).'+zeros(1,150)

más de 3 años hace | 1

| aceptada

Respondida
I have a menu in which a user selects a continent and enters in a year that they want to look at a set of data values for. How would I go about extracting the values in matrix
% user selects continent and year: [continent, con_data] = choose_continent(); year = choose_year_2(); % then store the row...

más de 3 años hace | 0

| aceptada

Respondida
I want the GUI to input a result from another m file in a static text box after clicking a push button.
As I understand the situation, you have an m-file that contains the code you posted, and you want to run that m-file from your G...

más de 3 años hace | 0

| aceptada

Respondida
Use "function name" (add, ...) to call this function but it is added
I notice that the function x4_ps looks like this: function x4 = x4_ps(~,p,s) % ^ indicating the first input ...

más de 3 años hace | 1

| aceptada

Respondida
Error using discretize: Bin edges must be a vector that is real, numeric or logical, and monotonically increasing.
load newdata load split_points_noID Not every row of split_points_noID is monotonically increasing, because there are some tra...

más de 3 años hace | 1

| aceptada

Respondida
ERROR // Array indices must be positive integers or local values
The error happens because sometimes the random value returned from rand is small enough that rand1 or rand2 is 0. Try replacing...

más de 3 años hace | 0

| aceptada

Respondida
How to delete a the min value of each group in a table?
% a simple table Data = table([1; 1; 1; 2; 2; 2],[1; 2; 3; 4; 3; 2],'VariableNames',{'Number' 'valdif'}) % findgroups, return ...

más de 3 años hace | 0

| aceptada

Respondida
why it not a number
syms T; Fx=3*T.^2-12*T+16; Fy=2-9*T+6*T.^2-T.^3; dx=diff(Fx, T); dy=diff(Fy, T); dx=dx.^2; dy=dy.^2; l=dx+dy; l=sqrt(l);...

más de 3 años hace | 1

Respondida
Finding rows of minimum valueS by group
Some data like your date3 and TimeToMaturity columns (just using 1, 2, 3, 4 for date here): date = reshape(repmat(1:4,5,1),[],1...

más de 3 años hace | 0

Respondida
How to compute number of bit change among consecutive binary numbers?
% A = 110; 101; 011; 111; 100; 001; 010 A = dec2bin([6; 5; 3; 7; 4; 1; 2],3) N = size(A,1); C = zeros(N); for ii = 1:N ...

más de 3 años hace | 0

Respondida
How do you use App designer to read files from a folder and then present those files in the gui for the user to select one or multiple from?
Here's a function (select_files) you can refer to when working on your app (or use this as-is). It uses a uitable and a uicontr...

más de 3 años hace | 0

Cargar más