回答済み
Convert a sequence of datetimes to seconds from first date
T=['07-Oct-2022 12:46:50';'07-Oct-2022 12:47:21']; DT=datetime(T) Tsec=seconds(DT-DT(1)) Subtracting the first datetime value...

3年以上 前 | 7

| 採用済み

回答済み
I get Arrays have incompatible sizes for this operation with an elseif statement what do i do?
A character array is just an array of bytes; the length of 'square' is six characters while the 'rectangle' is 9 -- indeed, they...

3年以上 前 | 1

回答済み
Make multiple vectors the same size
t=0.5:0.01:1.3; res=interp1(A(:,1),A(:,2),t).*interp1(B(:,1),B(:,2),t).*cos(interp1(C(:,1),C(:,2),t));

3年以上 前 | 0

| 採用済み

回答済み
Why do i get the error "inconsistent row/column dimensions" for line a=X\y
This time I formatted your code for you; in future use the "CODE" button to do so (or select code and use CTRL-E). Please add t...

3年以上 前 | 0

回答済み
Data not plotting as a 'stacked' bar chart?
bar is an abomination of an implementation -- it is documented that if the input data are a vector, the 'stacked' option is inte...

3年以上 前 | 1

回答済み
How to transform data to have new minimum, maximum and average values?
OK, this has been rumbling around in back of head since posted -- one way that keeps the original dataset and adjusts them withi...

3年以上 前 | 0

| 採用済み

回答済み
Tying to make an array of labels for a certain length
Why the min() operation? You'll need the same length of the quality indicator as the height of the data. I'd suggest approachi...

3年以上 前 | 0

回答済み
How to find the difference between two vectors
Well, this is a guess, but it appears that maybe you have x,y data strung together in a single vector and want to separate out t...

3年以上 前 | 0

| 採用済み

回答済み
Contour plot and line plot
That will have been done with subplot more than likely; the newer tiledlayout could also be used. Is there not the code with th...

3年以上 前 | 0

| 採用済み

回答済み
fft(x), why divide with L?
The short answer is "Because!" <VBG> The story behind the answer is in the reference document for the FFTW routine that MATLAB...

3年以上 前 | 0

回答済み
I'm adding legend in the graph for the 4 plot in the same graph, please help me in this.
Use something like legend('Y(11)','Y(12)','Y(13)','Y(14)',"Location","northeast"); instead. The legend entries are strings de...

3年以上 前 | 0

回答済み
How to set text position in yyaxis?
t = 1:0.1:10; yyaxis('left'); plot(t, sin(t), 'b.-', 'LineWidth', 2); ylabel('sin'); text(4,0.5,'left=0.5','BackgroundColor'...

3年以上 前 | 0

回答済み
Reading files with different extension from directory
The MATLAB builtin dir() function doesn't have the facility to handle multiple extensions in a single call; there are a couple o...

3年以上 前 | 1

| 採用済み

回答済み
linspace is causing an error
In %T= (9.68.*n2.^2)./(11.6964.*n2.^2)+(1-n2.^2).*(5.8564-n2.^2).*(sin((2*pi*D)./1)).^2 you're missing a needed set of parenth...

3年以上 前 | 3

| 採用済み

回答済み
Timestamp in ISO 8601 to yyyy-MM-dd HH:mm:ss
It's a pit(proverbial)a(ppendage) when vendor code produces nonstandard formats... S='0000-00-00T14:26:21:000'; % sample...

3年以上 前 | 0

| 採用済み

回答済み
How to delete all files with a certain extension?
Because your count variable is being incremented in the outer loop which is running over a dir() list of all files (including su...

3年以上 前 | 0

| 採用済み

回答済み
I need my graphs to display my data but they are showing up empty
No, the size of a is 1,1; the value of a is 3. Hence, you compute only one value and all your plot is/will be is a single point...

3年以上 前 | 1

回答済み
Polyfit plot just need one line
That looks like your data are just a scatter all over and you're asking polyconf to evaluate the fit and the intervals over all ...

3年以上 前 | 0

| 採用済み

回答済み
Link Excel spreadsheet to Matlab
sheet=get(ex.sheets,'Item',1); should work. There's a whole litany of what will/won't actually get resolved through the COM e...

3年以上 前 | 0

回答済み
How can one calculate Differentiation of matrix array with time as first column and data as second column ?
g=diff(v(:,2))./diff(v(:,1)); % numerical gradient The gradient vector estimate will be one element shorter than the inpu...

3年以上 前 | 1

回答済み
How to sort data files without actually writing these files
Well, maybe I'll take a shot at it and see if get the idea... First a comment on the existing code -- in ... l = fget...

3年以上 前 | 0

| 採用済み

回答済み
Read data from .txt file
The file and your local system LOCALE setting aren't in synch it appears -- the default MATLAB locale is US which uses the decim...

3年以上 前 | 0

回答済み
i have to get similar output as i have uploaded.why my data is getting repeated again and again?
Carrying on from @David Hill's most excellent start, tT=readtable(websave('input.csv','https://www.mathworks.com/matlabcentral/...

3年以上 前 | 0

回答済み
read text file - header and numerical part
Q1: A. See fgets to keep newline B: Don't need ExtractBetween, use ExtractAfter; then don't need the actual \n in the d...

3年以上 前 | 0

| 採用済み

回答済み
How to remove compare 2 arrays so that when there is a in a column, it removes the column in another array
You have only one row logical but three rows of labels??? But, assuming that's expected and the need is to remove all columns t...

3年以上 前 | 1

| 採用済み

回答済み
How to solve this errror about reading in complex numbers?
Previously answered what appears to be virtually identical Q? <answers/1818965-how-to-read-only-last-2-columns-of-csv-format-fi...

3年以上 前 | 0

回答済み
How do you insert a row or a column into a cell array?
No differently than with any other array -- although inserting in the middle somewhere requires copying (although with cell arra...

3年以上 前 | 3

| 採用済み

回答済み
How to label X-axis on bar graph?
cats=categorical(["Baseline";compose('Food deprivation(Week%d)',[1:3].')]); results=randi(20,4,1); bar(cats,results) The prob...

3年以上 前 | 1

| 採用済み

回答済み
How do I use a variable assigned in one function to call another function?
Forget global exists; for virtually all cases, it's not the better solution. Instead, use the return values your function(s) ca...

3年以上 前 | 0

| 採用済み

回答済み
one column in to multiple column
It's not possible to have a table with different number or rows by variable(column); MATLAB is NOT a spreadsheet (which is agood...

3年以上 前 | 0

さらに読み込む