Answered
Delete n elements of every 10 elements in string vector
Does this do it? ReName = Names(1:10:end)

4 years ago | 1

Answered
Extract the first two digits from a cell number
vnc = { ... 946210.887239541 5834.79659950033 2331.48462622471 1082.03333024461 555.948997161636 386.857494592061 1...

4 years ago | 1

| accepted

Answered
Function for creating matrix subgroups problem.
m = 5; n = 4; Aeq = [repelem(eye(m),1,n); repmat(eye(n),1,m)]

4 years ago | 1

| accepted

Answered
How do you plot multiple functions so they have their own subplot, but all have plots within the same figure window?
subplots are all in the same figure (a.k.a. window), by definition, so it's not clear exactly what you want to see. You are see...

4 years ago | 0

| accepted

Answered
program to save all single row vectors in workspace works as script but not as function
Try this. It's using same approach as in your script, except it's using evalin('caller',__) to get variable names and values fro...

4 years ago | 0

| accepted

Answered
Multiple inputs for one graph
Use strcmp() to compare character vectors; don't use == for that. And if you're plotting one point at a time, you have to use a...

4 years ago | 0

| accepted

Answered
For loop with subplots with uploaded
files = sprintfc('s1_r%d.txt',1:7).'; for ii = 1:numel(files) fil = ReadVerTxtData(files{ii},3); time =...

4 years ago | 0

Answered
How to define a text variable using an older text variable?
This will create a set of numbered variable names based on n. You can use the resulting m as your list of variable names. (Ther...

4 years ago | 1

| accepted

Answered
Xticklabels not labelling appropriate bars in barplot
If you're setting the XTickLabel you generally should also be setting the XTick: h = gca; h.XTick = 1:20; h.XTickLabel = Mdlu...

4 years ago | 1

| accepted

Answered
Why do I receive the error that arrays have incompatible sizes for this operation?
I guess those first three lines are supposed to be calls to input() A=('initial value:'); B=('number of values:'); C=('final ...

4 years ago | 0

Answered
Why do I receive the error Unable to use a value of type cell as an index?
Do you have a variable called table in your workspace? You can find out with whos('table') and if there is one, clear it with cl...

4 years ago | 0

Answered
Separate one column of in a multi-column, (which is itself a cell array) into two columns in the existing cell array
C = { ... 'E100M000.txt' '6109' '23-Sep-2020 14:…' 0.04 {'A' 1} 4 2971.6 'Pleasant Valley…'; ... 'E100M001.txt' '6109'...

4 years ago | 0

| accepted

Answered
how to set the final value for a for loop
To make the last element of t equal to 24 if it's bigger than 24: t=0.01; for i=1:82 t(i+1)=t(i)*(1.1); end if t(end) >...

4 years ago | 0

Answered
How to compare the contents of two tables?
Here is something that will print changes in the tables to the command-line: tab_jan = readtable('jan.csv'); tab_feb = readtab...

4 years ago | 0

| accepted

Answered
Store elements of a matrix but ONLY IF the respective element of ANOTHER matrix meets condition.
It looks like matriz_angulodecarga has no elements that are less than 0.9. Is it possible the conditions got swapped inadvertent...

4 years ago | 1

| accepted

Answered
plotting multiple columns of a text file in one graph
The code seems to work, but I guess the plot is not what you expected to see. A = load('cooling_test.txt'); x=A(:,1); y=A(:,2...

4 years ago | 0

Answered
code that randomly changes columns in matrix throws error
It seems to be working for that matrix D: D = [ ... 1 2 3 4 510.090...

4 years ago | 0

| accepted

Answered
How do I extract each excel file from their subfolders and combine them into one?
Here is a general approach, but it may need to be modified depending on what exactly is in your files. rootdir = 'C:\path\to\yo...

4 years ago | 2

| accepted

Answered
How to find prices that occur on the same dates for two sets of stock index prices
shorterarray = {'1/1/2020' 60; '2/1/2020' 70; '4/1/2020' 80} longerarray = {'1/1/2020' 60; '2/1/2020' 65; '3/1/2020' 75; '4/1/2...

4 years ago | 0

| accepted

Answered
Why wont my code plot anything
It doesn't appear to plot because e is a scalar. e is a scalar because it's overwritten each time through the loop. Instead, ma...

4 years ago | 0

| accepted

Answered
How to extract digits
Assuming they're all positive numbers, you can try this (the 2-digit result won't be accurate for one-digit numbers): a = [438;...

4 years ago | 1

| accepted

Answered
Irregular intervals inside a for loop
n = 2; m = 3; z = n+m; for p = 1:20 if ismember(mod(p,z),1:n) disp('Action A'); else disp('Action...

4 years ago | 1

Answered
Error normalising multiple data sets with the same parameters
Assuming you already have gotten the ZData of each object whose ZData you want to normalize "globally", you can do this to norma...

4 years ago | 1

| accepted

Answered
rename files inside the folder
old_file_names = { ... '1_ss_ddd_080_y000.txt', ... '1_ss_ddd_080_y001.txt', ... '1_ss_ddd_080_y002.txt'}; new...

4 years ago | 0

| accepted

Answered
How to transform struct to array?
S = struct('field_1',1,'field_2',2,'field_3',3) A = struct2array(S).'

4 years ago | 0

| accepted

Answered
How to plot the function f(1/z) in matlab where z is any complex number
You say p=f(z), so that p is the value of the function f at some particular value(s) of z. Then you do polyval(p,1/z), which do...

4 years ago | 0

| accepted

Answered
Why i get problems with index arrays although it seems to have correct Input?
length(A) is the size of the array A in its longest dimension, so length(Matrix) in this case is 13, not 3. You should use size...

4 years ago | 0

Answered
How do i divide excel cells with each other from matlab
This will divide each element in columns 3 and 8 in "Svendborg pyra 1 skyet.xlsx" by the element at the same location in "Svendb...

4 years ago | 1

| accepted

Answered
Sort cell numbers ?
"What I mean is how can I organize G in this way?" G = {[-6; -7] [-16;-15] [-26;-22] [-33;-30] [-50;-47] [-65] [-83;-84]}; May...

4 years ago | 0

| accepted

Answered
Converting location of a 2x3 vector into a matrix with value 1
a = [1 3 2 4 7 8]; Z = zeros(10,10); Z(sub2ind(size(Z),a(:,1),a(:,2))) = 1

4 years ago | 1

| accepted

Load more