Réponse apportée
rlocfind returns error: Execution of script poly as a function is not supported
"Execution of script poly as a function is not supported" You have created a script named POLY. Rename that script. To find th...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Inverse Matrix for 6x6 matrix with variables
syms x y z A = [x,y,y,0,0,0; y,x,y,0,0,0; y,y,x,0,0,0; 0,0,0,z,0,0; 0,0,0,0,z,0; 0,0,0,0,0,z]; b = inv(A)

plus de 2 ans il y a | 0

Réponse apportée
Trouble with date conversion
Rather than fiddling around with text or numerics, just import the 2nd column as DATETIME right from the start: fnm = 'uurgeg_3...

plus de 2 ans il y a | 2

Réponse apportée
How to know exactly what row (or index number?) in a table based on user input?
Fake data: dt = datetime(2023,11,1:7).'; V = rand(7,1); T = table(dt,V) Date that you want: want = datetime(2023,11,4) Obt...

plus de 2 ans il y a | 0

Réponse apportée
Is there a way to dynamically use either brackets or curved bracket indexing depending on a variable?
"I understand it can be done with if statements but this will take up massive amounts of space in the code so I try to avoid it....

plus de 2 ans il y a | 2

| A accepté

Réponse apportée
Do mex functions support keyword assignment syntax?
A few simple experiments show that key=value assignment is converted by the parser into 'key',value. I don't see why it would be...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Replacing values in a Matrix
A = [25,40,40,40,25,25,25,25,25,25; 25,40,40,40,40,25,25,25,25,25; 25,25,40,40,40,40,25,25,25,25; 25,25,40,40,40,40,40,25,25,25;...

plus de 2 ans il y a | 2

Réponse apportée
how convert string in struct with 0/1
S = struct('FS',{'Si','No','Si','Rank','No'}) Z = nan(size(S)); [X,Y] = ismember({S.FS},{'No','Si'}); Z(X) = Y(X)-1

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to assign a mean of a variable to every year ?
The simple and efficient MATLAB approach: DateYear = [2016;2016;2010;2008;2016;2016;2009;2008;2007;2010]; SeverityCode = [3;3;...

plus de 2 ans il y a | 1

Réponse apportée
Convert char to table
If you already have a character vector and the goal is to print it to file, then avoid the indirection of converting to numeric ...

plus de 2 ans il y a | 1

Réponse apportée
Readtable Returns "NaN" to the string type value if one column contains both number type and string type values
Use READCELL: C = readcell('test.csv') Everything that is text is text, everything that is numeric is numeric. Easy.

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How can I improve my regular expressions?
Get rid of the look-behind expressions. They don't restrict which block of data is being read anyway. Also note that '.' matche...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Conditional Question Matlab Disagreement
"...but my teacher says it’s one and I’m super confused. Any explanation would be appreciated, thanks!" This code (6+3)>8>2 i...

plus de 2 ans il y a | 1

Réponse apportée
Extracting value from array
"For one value it does work, but not for all of them." It does work, your screenshot clearly informs us that you are getting on...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 0

Réponse apportée
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...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 4

| A accepté

Réponse apportée
Extract indices of vector?
X = find(B)

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 1

Réponse apportée
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...

plus de 2 ans il y a | 2

| A accepté

Réponse apportée
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 ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
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'));

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 2 ans il y a | 0

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

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
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

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
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}]

plus de 2 ans il y a | 1

Réponse apportée
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...

plus de 2 ans il y a | 0

Réponse apportée
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...

plus de 2 ans il y a | 0

Charger plus