回答済み
Saving a new table for every loop iteration
Don't do that. Dynamic variable creation is a bad idea and totally unnecessary. <https://www.mathworks.com/matlabcentral/answ...

8年以上 前 | 0

| 採用済み

回答済み
How to check monotonity of a vector?
use diff <https://www.mathworks.com/help/matlab/ref/diff.html> along with all maybe a = 1:10; isIncreasing = all(dif...

8年以上 前 | 3

回答済み
How to circular shift a matrix for every 1 to 6 elements until its end?
I'm only guessing. If you want to do circshifts for blocks of columns, use mat2cell first, do the shifting and convert it back u...

8年以上 前 | 0

| 採用済み

回答済み
How do you check if all the values in a vector are in another vector as many or more times?
I'd recommend using intersect since you want to handle repeating elements as well. For example, a=[1 1 3 4 4]; b=[3 3 4 7]...

8年以上 前 | 0

回答済み
How to plot more than 1 curves in one graph.
if they are in columns of excel, read it as a matrix (for a all-numeric matrix), data = xlsread(filename); now let's say ...

8年以上 前 | 0

回答済み
If i have a graph that levels off, how can i find the first x value this occurs at, on matlab?
It depends on how you've stored your data. Let's you have them in a matrix, data = [(1:10)' zeros(10,1)]; data(5,2) = 10; ...

8年以上 前 | 0

回答済み
How to accept only numbers in this case?
use uieditfield <https://www.mathworks.com/help/matlab/ref/uieditfield.html> fig = uifigure; edt = uieditfield(fig,'num...

8年以上 前 | 1

回答済み
How can i specify which subplot that i want to plot on it?
use axis handles, ax1 = subplot(2,1,1); something ax2 = subplot(2,1,2); something now again go back to ax1 ...

8年以上 前 | 2

| 採用済み

回答済み
how i do loop over column?
If you want to do time-based calculation with your data, for example, weekly average or something I'd highly recommend using tim...

8年以上 前 | 0

| 採用済み

回答済み
Inefficient code - simple counter
I suppose your condition is something like checking the range of the specific element. Depending on what range they are in you w...

8年以上 前 | 0

| 採用済み

回答済み
two for Nested Loops
An example with timetable, *EDITED* %import data data = readtable('actual data.txt'); %create a proper datetime co...

8年以上 前 | 0

回答済み
Generic index select, without loops
V1=[45 23 26 17 29]; V2=[3 5] ; V3 = V1(~ismember(V1,V1(V2))) V3 = 45 23 17

8年以上 前 | 0

| 採用済み

回答済み
How do I extract data from multiple matrices with double variable?
Oh no! Don't do that. When you can store all your data in *one* variable, why would you prefer a complex way (creating multiple ...

8年以上 前 | 1

| 採用済み

回答済み
Split array into sub arrays
Or use mat2cell, res = mat2cell([x y z].',3,diff([0 find(data) numel(data)])) you get the result in a cell array, each ce...

8年以上 前 | 1

| 採用済み

回答済み
Multiplying matrices and vectors in loop
_they are all 3 x 3..._ No, they are not. Check the output for the following size(CA) size(CF) and the other matrice...

8年以上 前 | 0

| 採用済み

回答済み
How to check if several variables are not equal ?
use isequal. It checks all the inputs are equal and if yes, it returns 1. Use |~| if you want only the else case. if isequal...

8年以上 前 | 0

回答済み
How can I set the numbers of decimals (precision) of the solution of fminunc?
Use the StepTolerance option, options = optimoptions(@fminunc,'StepTolerance',0.01); <https://www.mathworks.com/help/opti...

8年以上 前 | 0

回答済み
Determine averages for duplicate values
use a table and then varfun with grouping variable as your station name, T = cell2table(C,'v',{'stationName','channelName',r...

8年以上 前 | 0

| 採用済み

回答済み
Copy of multiple equal size arrays into one big array using loop
Use counter variable on the third dimension if your matrix is 2D already, for example, arr(:,:,counterVar) or a cell arra...

8年以上 前 | 0

回答済み
How to Horizontally concatenate the values of a matrices present inside a cell array using loops?
if C is your cell array, x = cellfun(@(x)reshape(x,size(x,1),[]),C,'uni',0)

8年以上 前 | 0

| 採用済み

回答済み
proof if value is greatest of a range of Values
Yes, you could do that but I'm unsure if you'd really need a for-loop. If you could explain your real intentions, the actual sol...

8年以上 前 | 0

回答済み
how to combain matrix with vector
Something like this? a = [9 8 7; 6 5 4]; v = [1 2 3 4 5]; sz = size(a); a = [a inf(sz(1),size(v,2)-sz(2));v]

8年以上 前 | 1

回答済み
How to call the rows of a matrix without the for loop
Probably convert them to cell array and then the use of comma-separated lists, B = num2cell(A,2) and then your_progra...

8年以上 前 | 0

| 採用済み

回答済み
What can I write in a MATLAB function block in Simulink?
_If s is a vector, I will just count the number of negative entries, and then shift the y by this amount_ Shouldn't you be si...

8年以上 前 | 1

回答済み
How to find out mean within a loop?
Store the result from each iteration and then calculate mean outside the loop. Capacitance1 = zeros(1,Number_of_measurements...

8年以上 前 | 1

| 採用済み

回答済み
for loop only shows value of last iteration.
You're overwriting all your variables inside the loop so you'd only see the result of the last iteration. You'd need to use arra...

8年以上 前 | 0

回答済み
how to extract corresponding file name from recognized index
Your code snippets are quite unclear but if you want to index certain elements from the |dir| output, that's just like indexing ...

8年以上 前 | 0

| 採用済み

回答済み
why this error occur ??Index exceeds matrix dimensions.
You can easily access those elements just by accessing thier corresponding indices but you should make sure you accessing elemen...

8年以上 前 | 0

| 採用済み

回答済み
how to duplicate each cell in an array
Something like this maybe, n = 3; array1 = [1,2,5]; array2 = reshape(array1.*ones(n),1,[]) 1 1 1 ...

8年以上 前 | 0

| 採用済み

回答済み
Subscripted assignment dimension mismatch.
|imread| returns a 3D matrix. If you want to read multiple images and store them in one matrix, use a 4D matrix, for k = 1:3...

8年以上 前 | 0

| 採用済み

さらに読み込む