Réponse apportée
Replace a single character with a new line in a string
>> s= 'hello there how are you today'; >> strip(split(s,'w')) % if the location is a known character... ans = 2×1 cell ...

plus de 6 ans il y a | 0

Réponse apportée
normcdf: speed impact by vectorization
Yeah, there is... -- >> a = -50:0.01:50; >> total_cnt = 10000; >> a_mod = repmat(a, 1, total_cnt); >> whos a a_mod Name ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
using fsolve when the function handle takes in 2 variables that are both vectors
Recast as 4-vector w/ v(1:2) -- x; v(3:4) -- y: fun2=@(x) [exp(-exp(-(x(1:2)+x(3:4)))) - x(1:2).*(1+x(1:2).^2); ... ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to create a vector which displays the letters used in an already existing string?
>> unique(erase(s,' ')) ans = 'adehijlmnosuwy' >> unique(erase(s,' '),'stable') ans = 'helomynaisjwdu' >> >> uni...

plus de 6 ans il y a | 0

Réponse apportée
Multi-colored tick labels in bold, redux
Looks mostly to be the choices for the rgb triplets aren't very distinctive, but a contributing factor is there just aren't many...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
averaging values in a table in succession
t=readtable('nim123.xlsx'); % read the data t(all(isnan(t{:,:}),2),:)=[]; % remove the blank lines at beginning...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
put a missed data in a cell
If you build the cell content, there's no reason shouldn't be able to just assign it to the cell array where it belongs. Then j...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
[DEPRECATED] What frustrates you about MATLAB?
Why can't MATLAB/TMW figure out to not open new figure default inside command window space so the next command to put on some am...

plus de 6 ans il y a | 0

Réponse apportée
How to plot z values against year in x-axis and months in y-axis?
[Y X]=meshgrid([1:12],tRAIN.YEAR); contour(X,Y,tRAIN{:,2:end}) yticklabels(tRAIN.Properties.VariableNames(2:end)) Just for co...

plus de 6 ans il y a | 0

Réponse apportée
Calculating average of cell arrays
mnTemp=cellfun(@(t) mean(t.precip),SAMPLE); with the sample dataset: >> cellfun(@(t) mean(t.precip),SAMPLE) ans = 27.898...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
How to export the result of the function fit to a file?
It's not a symbolic object, nor a function--it's a cfit object. It has associated methods and the default method is to evaluate...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Setting certain edges of a graph a different color
You mean like the following: subplot(2,1,1) plot(rand(10,1)) title('default -- top/bottom outlined w/ box on') subplot(2,1...

plus de 6 ans il y a | 0

Réponse apportée
create vector with number of hour per years
Oh. I see at the beginning you did create a timetable -- good! Just use it-- tt_BUOY_ERA5.Properties.DimensionNames={'Time','...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How can I read block of data using textscan?
Basics are: fnames={'Lpp','xnstrp','nptstrp','offsets','c'}; % define struct fieldnames inp=cell2struct(cell(5,...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
[DEPRECATED] What frustrates you about MATLAB?
Inconsistency in names for Name-Value Pair arguments in new functions of similar purpose and name. Since inception which predat...

plus de 6 ans il y a | 2

Réponse apportée
Is calling length() as needed slower than storing the value just once in a separate variable?
Any computation has a finite speed...even memory access alone. Builtin data types contain a knowledge of the dimensions allocat...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
the reason of why there is a warning like that?
<Answers/99745-why-do-i-get-warning-message-matrix-is-close-to-singular-or-badly-scaled?>

plus de 6 ans il y a | 0

Réponse apportée
importing data using function change the colomns order
Worked ok here... >> data=import_sitefile('strikeLdep5.dat',22); >> whos data Name Size Bytes Class ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to remove color bar in the matlab heatmap and add one to the whole subplot?
ERRATUM: My bad, I had other figures around and didn't realize the heatmap object is child of the figure, not of an axes on the...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How do I plot both of these different sized arrays on the same plot?
... plot (Tgb,Ygb) ... plot (Tgb,Ypp) plot (Tpp,Vgb) ... plot (Tpp,Vpp) For some reason, you're mixing metaphors here b...

plus de 6 ans il y a | 0

Réponse apportée
Only can detect the last word in edit text that need to be translated.
a = upper(get(handles.edit1,'string')); % uppercase, char string array b = get(handles.popupmenu1,'value'); morse=string({...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Turning cells created with a for loop back to an array by using a for loop after doing calculations on it
filenameExport = 'test.xlsx'; E = 0.059417; t0_row = 15; ...

plus de 6 ans il y a | 0

Réponse apportée
Search through every vector in cell array for the vector that contains a certain value
Your code above doesn't save the result going thru the loop so you only show the final result at the end--- ix=cellfun(@(v) ism...

plus de 6 ans il y a | 1

Réponse apportée
randi 0 to 3 (2bits)
v=randi([0 3],16384,1,'int8'); % save as int8; ML doesn' have arbitrary length integers. You can visualize what have with ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
adding a value to all values in a table
You address the variables in a table with the dot notation -- t.Var1=t.Var1+300; % store in place t.Var2=t.Var1+300; % make ...

plus de 6 ans il y a | 0

Réponse apportée
Please help me run this - I can't figure out this error!
xp(:,pp)=chopit(x+(w.*v)(pp)-(1-w)*c(pp),xcrit,Cap); Missing an operator between (w.*v) and (pp) or what variable pp is suppose...

plus de 6 ans il y a | 0

Réponse apportée
How to retrieve a table entry using row name?
It's a table; use the curlies "{}" to dereference row names to return the content of the row or regular paren's "()" to return a...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Two labels for xaxis for bar graph
Per above, you must have a second axes. And, you can do it with only one bar plot instead of two... ip=(a>=0); % logi...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Histogram with data frequency
nc=accumarray(X.',Y.'); bar(1:numel(nc),nc)

plus de 6 ans il y a | 0

Réponse apportée
avoid inserting input as a string with ' '
"So in case i want to call my input variable (valuesSwitched) in the second case one or two, I should ALWAYS use a string like '...

plus de 6 ans il y a | 0

Charger plus