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

3 years ago | 0

| accepted

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

3 years ago | 0

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

3 years ago | 1

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 1

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 0

Answered
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_...

3 years ago | 0

| accepted

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

3 years ago | 1

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 1

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 0

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

3 years ago | 0

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

3 years ago | 0

| accepted

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

3 years ago | 0

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

3 years ago | 1

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 1

| accepted

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

3 years ago | 1

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 0

| accepted

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

3 years ago | 1

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

3 years ago | 0

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

3 years ago | 0

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

3 years ago | 0

Load more