Respondida
Writing a summation code where i≠j
The weight matrix is zeros along the diagonal. Thus you can use it as-is in the summation, since the terms where i==j (which cor...

alrededor de 4 años hace | 1

| aceptada

Respondida
Add data labels to scatter plot
tenFootHorizontal = [2,3,-4,-1]; tenFootVertical = [1,3,0,.5]; scatter(tenFootHorizontal,tenFootVertical,'red','filled'); %...

alrededor de 4 años hace | 0

Respondida
Maximun value of a different profiles
It's not clear why you set sm=mm. That will cause the for loop to iterate once, plotting only the last profile. (Maybe that was ...

alrededor de 4 años hace | 1

| aceptada

Respondida
How to use regexprep to modify strings while keeping constituent numbers intact?
You can capture the V_1, V_2, etc., in tokens, then place those tokens in the output of regexprep by specifying $1 in patternToR...

alrededor de 4 años hace | 1

| aceptada

Respondida
Trying to have a Matlab line plot with Xticks coresponding to numbers with unequal numerical gap but equal spacing.
It looks like your xticks and xticklabels are ok (except you don't need to set them more than once - you also don't need to do h...

alrededor de 4 años hace | 0

Respondida
How to add replay button?
Create a new button: h.replaybutton = uicontrol( ... 'Parent',h.f, ... 'Units','normalized', ... 'Position',[0.8...

alrededor de 4 años hace | 0

| aceptada

Respondida
Plotting large data set within for loop
[numRows , numCols] = size(D); for ii = 1:numCols/2 figure() plot(D(:,2*ii-1),D(:,2*ii)) title(sprintf('Cross ...

alrededor de 4 años hace | 1

| aceptada

Respondida
Can't figure out how to find what is wrong with my code
Consider this piece of code at the end: if(option == 6); for(k = 1 : length(inspection) ); printf("%...

alrededor de 4 años hace | 0

| aceptada

Respondida
I want to concatenate two coloumns of table.
Let's say you have a table t with variables freqa and freqb. freqa = [950; 2000; 3000; 4000]; freqb = [1500; 2070; 3070; 4070]...

alrededor de 4 años hace | 0

Respondida
Need help creating a loop that outputs the mean of each row of every 6th column into a new matrix
First, creating some random data: n_subjects = 25; n_variables = 6; n_repetitions = 3; n_conditions = 4; % data_in: 25x73...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to get all combinations of PRODUCTS between two array elements?
A = [5 6 8 9 7]; B = [3 4 5]; A.*B.'

alrededor de 4 años hace | 0

| aceptada

Respondida
Convert negative values to zero in timetable
% a timetable with 3 data columns: Holly_NOx = timetable(datetime(now+(-29:-22),'ConvertFrom','datenum').', ... randn(8,1)...

alrededor de 4 años hace | 0

| aceptada

Respondida
how to make matlab save (filename) command work?
save saves to a mat file, so what is happening when you do this save('untitled2.m') is that a file is created called untitled....

alrededor de 4 años hace | 0

| aceptada

Respondida
For Loop only showing data for last file within Array
Make data_in a cell array, and store the contents of each file in a different cell of data_in: clear all; clc [file_list, pa...

alrededor de 4 años hace | 0

| aceptada

Respondida
how to read multiple sheets of excel file using readtablle command. The way we do using xlsread(fileName,'sheet1')
% a = readtable(file, 'Definitions') % not this a = readtable(file, 'Sheet', 'Definitions') % this

alrededor de 4 años hace | 1

| aceptada

Respondida
Can we change the size of cell inside the cell array?
% a cell array of size 3X6 and each cell contains 6x1 matrix C = cell(3,6); for ii = 1:size(C,1) for jj = 1:size(C,2) ...

alrededor de 4 años hace | 2

| aceptada

Respondida
can I compare the previous state with current state in " While loop " ?
X_current = 1; X_previous = 0; while true fprintf('current = %4.2f, previous = %4.2f\n',X_current,X_previous); if ab...

alrededor de 4 años hace | 0

| aceptada

Respondida
Removing scientific notation in log plot
FreqS = 0.1:0.1:20; Tunability2D = rand(1,numel(FreqS)); figure('Name','2D Tunability') plot(FreqS,Tunability2D,'k','LineWi...

alrededor de 4 años hace | 0

| aceptada

Respondida
non square matrix interpolation matlab (colorgraph)
There is an error in how your matrices X and Y are constructed: nfil and ncol are swapped in those two for loops. It's corrected...

alrededor de 4 años hace | 2

| aceptada

Respondida
Not enough input arguments. Error in Kapur (line 4) fitR = zeros(1,m);
This error is happens when you run a function by clicking the green Run button in the MATLAB editor, when the function expected ...

alrededor de 4 años hace | 0

Respondida
Saving variables in a live editor script to an excel file
Using writecell would probably be the easiest way to do this. You can use 'WriteMode','append' where appropriate. % specify the...

alrededor de 4 años hace | 0

Respondida
What is the difference between run, run and advance run to end?
See documentation here: https://www.mathworks.com/help/matlab//matlab_prog/create-and-run-sections.html#mw_eb835312-5b90-4eb9-a...

alrededor de 4 años hace | 0

Respondida
Why do i get ""
It's only a warning (not an error), so you don't have to solve it. getInterpolationArrays is written such that xp is construct...

alrededor de 4 años hace | 1

| aceptada

Respondida
Changing numbers in dataset
Considering that -1 can be written as -1+(0/4), a pattern becomes clear: 1 -> -1+(0/4) 2 -> -1+(2/4) 3 -> -1+(4/4) 4 -> -1+(...

alrededor de 4 años hace | 1

| aceptada

Respondida
Why this loop is executing 4 times?
SIGMA is of size 1-by-4, and the loop goes from 1 to length(SIGMA) (which is 4), so what else would you expect? SIGMA = 0:0.05:...

alrededor de 4 años hace | 0

| aceptada

Respondida
Where is the error in my code?
Check the value of r: r = 0:0.07 It is a scalar wth value 0 because the colon operator ":" uses an increment of 1 by default. ...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to display data on uitable from selected name in the listbox GUI MATLAB?
If the table should initially be empty, then in the OpeningFcn, initialize the Data of handles.uitable1 to be cell(0,7). (That i...

alrededor de 4 años hace | 0

| aceptada

Respondida
Import data from text file with lines of unequal length as fast as possible.
I don't know if it's "as fast as possible", but this may be faster than fgetl/str2num: fid = fopen('sample.txt'); A = {}; tic...

alrededor de 4 años hace | 1

| aceptada

Respondida
How to reformat this table's information so that a column of data becomes the header's for matching data?
Here's one way to do it: % construct the initial table: Items = ["Item1";"Item2";"Item3";"Item4";"Item5";"Item6";"Item7";"Item...

alrededor de 4 años hace | 1

| aceptada

Respondida
Does surf() Behave as Expected with ndgrid() Inputs?
"Why isn't Case 4 the same as Case 2?" Because Case 2 is erroneous. For vectors X and Y input to surf, matrix Z must be of size...

alrededor de 4 años hace | 2

| aceptada

Cargar más