Answered
how to load all mat files in the filenumber wise sequentially ?
Follow this link and click the big DOWNLOAD button in the top right corner: https://www.mathworks.com/matlabcentral/fileexchang...

3 years ago | 1

| accepted

Answered
surf for n-dimensional cartesian matrix
Perhaps one of these: https://www.mathworks.com/help/images/ref/sliceviewer.html https://www.mathworks.com/help/images/ref/vol...

3 years ago | 0

Answered
Creating a new matrix from unique combinations in two other matrices
[A,B] = meshgrid(repelem(1:3,3),1:3) M = [reshape(A.',[],1),reshape(B.',[],1)]; [~,~,X] = unique(M,'rows','stable'); C = resh...

3 years ago | 0

| accepted

Answered
Reshape data the first row becomes the different columns
ID = [1;1;1;2;2;2]; Date = datetime(2015,1,[1;2;3;1;2;3]); vals = [0;0.5;-0.3;0;0.2;0.5]; T = table(ID,Date,vals) U = unstac...

3 years ago | 4

| accepted

Answered
Extract indices of vector?
X = find(B)

3 years ago | 0

| accepted

Answered
Error using readtable '.1(0a)' is not a recognized file extension. Unable to detect file type.
I strongly recommend avoiding forcing meta-data (e.g. filenames) into structure fields like that. To make your approach work wou...

3 years ago | 0

| accepted

Answered
I have error when i convert modified julian data to datetime
"how can i convert time_mjd to exact same date with time0?" The short answer is that you can't, simply because the limited prec...

3 years ago | 1

Answered
how can a symbolic derivative be vectorized automatically?
Use MATLABFUNCTION: syms a b c f = a*sin(b)*exp(c) df = diff(f,b) mf = matlabFunction(df) a=rand(10,1); b=rand(10,1); c=r...

3 years ago | 2

| accepted

Answered
loading multiple csv files using readmatrix
Use DIR: P = 'C:\My\Folder'; S = dir(fullfile(P,'*.csv')); for k = 1:numel(S) F = fullfile(P,S(k).name); S(k).data ...

3 years ago | 0

| accepted

Answered
3D Submatrices extraction by indexing the 3rd dimension
a_substruct.m1 = a_struct.m(:,:,endsWith(a_struct.i,'1')); a_substruct.m2 = a_struct.m(:,:,endsWith(a_struct.i,'2'));

3 years ago | 1

| accepted

Answered
How to call a variable from one program to another program 2 in app designer?
I am guessing that you actually require element-wise division, not matrix division: https://www.mathworks.com/help/matlab/matla...

3 years ago | 0

Answered
textscan gives empty cells?
url = 'https://www.cpc.ncep.noaa.gov/data/indices/sstoi.indices'; The best approach using READTABLE: tbl = readtable(url, 'Fil...

3 years ago | 1

| accepted

Answered
how two use winopen command with path assigned in a Variable?
winopen(MyPath) https://www.mathworks.com/help/matlab/matlab_prog/command-vs-function-syntax.html

3 years ago | 1

| accepted

Answered
Convert cell of mixed real and complex numbers into double
Without evil STR2NUM: C = {1.0000e-03,0;0,'10.06+28.21i'} M = str2double(C); X = isnan(M); M(X) = [C{X}]

3 years ago | 1

Answered
fsolve with 7 equations 6 unknowns: Error using vertcat Dimensions of arrays being concatenated are not consistent
f = @(x) [0.05*F*x(1) - x(5)*x(1)*F; 0.95*F*x(4) - (1-x(5))*x(4)*F; (y_ar)+(x(2) - x(4))+(x(1) - x(3)) - ... (((1...

3 years ago | 0

Answered
Indexing String Structure Fields
The basic problem is that you are attempting element-wise comparison of character vectors (of different sizes) using EQ. That wo...

3 years ago | 0

Answered
Nesting of tiledlayout objects not possible in R2019b?
Nesting TiledChartLayout objects was introduced after your version, in R2020a: https://www.mathworks.com/help/matlab/release-no...

3 years ago | 1

| accepted

Answered
Summing a 30x30x30 matrix.
a = reshape(1:30*30*30,30,30,30) b = reshape(sum(reshape(a,10,3,10,3,10,3),[1,3,5]),3,3,3) sum(a(1:10,1:10,1:10),'all') % for ...

3 years ago | 0

Answered
f(x)=x²+2.000 syntax code
f = @(x) x.^2 + 2; fplot(f)

3 years ago | 0

Answered
Plotting 'HH:MM' format times against the X axis
"taking my times (zero to 23:50 in ten minute incriments) and converting to decimal then 'HH:MM' format" Do not convert to "dec...

3 years ago | 0

Answered
How to process excel data with Chinese dates
"How to process excel data with Chinese dates" It is a CSV file (i.e. text), not a proprietary Excel file. fnm = '日期.csv'; ty...

3 years ago | 0

Answered
Return largest number of decimal places in a vector of numbers
x = [0.123456789,0.1,0.12,0.123]; n = strlength(compose("%.15g",rem(abs(x),1)))-2

3 years ago | 1

Answered
Mix two different size arrays
A = rand(1,3) B = rand(1,7) N = min(numel(A),numel(B)); C = [reshape([A(1:N);B(1:N)],1,[]),A(N+1:end),B(N+1:end)]

3 years ago | 0

| accepted

Answered
Split increasing vector into n unqueal parts based on multiples of n
S = load('Denc.mat'); D = S.Denc B = 0:2300:2300+max(D) X = discretize(D,B); C = accumarray(X,D,[],@(a){a})

3 years ago | 0

| accepted

Answered
How to take a value between two values
d = [11,15,21]; X = [10.2,13.5,20,22.4]; Y = [1.6,1.8,2,Inf]; Z = interp1(X,Y,d, 'previous')

3 years ago | 0

Answered
How to change the default color order for all figures?
M = rand(5,7); plot(M) newcolors = [0.83,0.14,0.14; 1,0.54,0; 0.47,0.25,0.8; 0.25,0.8,0.54]; set(groot, "defaultaxescolororde...

3 years ago | 1

| accepted

Answered
how to assign rank to each row?
A = [1,4;1,4;4,1;4,1;2,2;2,3;2,3;3,2;3,3] B = cumsum([1;any(diff(A,1,1),2)])

3 years ago | 0

| accepted

Answered
Which character conversion notation do I have to use?
T = readtable('ct4004355_si_003.txt', 'Delimiter','\t', 'TextType','string')

3 years ago | 0

| accepted

Answered
Keep matrix structure after indexing
out = nan(size(temp)); out(A) = temp(A); Or out = temp; out(~A) = NaN;

3 years ago | 1

| accepted

Answered
Error replacing content of timetable with cell array
Note that storing lots of scalar string arrays inside a cell array is inefficient and misses out on the benefits of using string...

3 years ago | 0

| accepted

Load more