Réponse apportée
Extreact Information from a String
regexp would be the best idea, I've no big experiences with it, I'll give it a shot anyway, names = {'Data_c11_t3.322111_id0...

plus de 8 ans il y a | 2

| A accepté

Réponse apportée
How can I change cell array into strings
cc = cellfun(@num2str,c,'uni',0) if you have both string and numerics in cell array and you want to convert them all to char...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
how to find norm of each vector in one matric in Matlab?
sqrt(sum(A.^2,2))

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
Compare the results of A*B, A/B, B/A and explain the significance
like this? >> A = rand(3); >> B = rand(3); >> isequal(A/B,B/A) ans = 0

plus de 8 ans il y a | 0

Réponse apportée
USING FOR LOOP TO PLOT SEVERAL LINES
something like this? plot(X(:),Y(:))

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Different arrays to one text file
store them in a cell array and use fprintf, yourCell = {'a', 'b', 'c'; 1, 2, 3}; fprintf('%s %d\n',yourCell{:});

plus de 8 ans il y a | 0

Réponse apportée
How do I create a table as a subplot?
You should probably create a GUI with plots and table. As with all the other functionalities, there's great documentation and ex...

plus de 8 ans il y a | 0

Réponse apportée
Using an if/else statement inside of a for loop
Perhaps you want something like this, y=load('Class19_survey.txt'); ag=0; ne=0; dis=0; for k=1:length(y) ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How can I change the colour of a node
use highlight <https://de.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.graphplot.highlight.html> h = plo...

plus de 8 ans il y a | 1

Réponse apportée
How can I find the distance between 2 points
use distances <https://de.mathworks.com/help/matlab/ref/graph.distances.html> distances(G)

plus de 8 ans il y a | 0

Réponse apportée
How to plot a different colored area of negative and positive elements in an array?
use area <https://de.mathworks.com/help/matlab/ref/area.html> pos = Data; pos(pos<0)=nan; neg = Data; neg(neg<0)=nan;...

plus de 8 ans il y a | 1

Réponse apportée
How to plot monthly values of precipitation over multiple years and have years plotted on x-axis
reshape your data by keeping year on the rows, months on columns (hence, 12 columns and as many rows as many years you have), th...

plus de 8 ans il y a | 0

Réponse apportée
How to use dates as x axis?
You could use them as xticklabels and use the datestr of your datetime values. There are also more easier possibilities like...

plus de 8 ans il y a | 0

Réponse apportée
How to label dates on X-axis as string on monthly time step?
You already have year and month on the xaxis of the attached image but anyway, you could directly plot with the datetime on xax...

plus de 8 ans il y a | 0

Réponse apportée
How to use \n and \t with sprintf to set the string of a ui control
You could use a cell array, C = {'Hello!'; 'How are you?'}; x = sprintf('%s\n%s',C{1,1},C{2,1});

plus de 8 ans il y a | 0

Réponse apportée
Vector of values error for loop
r1_tot = linspace(0.01,0.35,25)

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Troubleshooting mean square error for loop
It's hard to answer without knowing what's happening inside your function but anyway I can give you few tips. ParThK2Q = 0.0...

plus de 8 ans il y a | 0

Réponse apportée
i have trouble making this into a for loop.
you don't need for loop. Create a datetime vector and do it the proper way. dt = datetime([2017 01 01 00 00 00]):hours(1):da...

plus de 8 ans il y a | 0

Réponse apportée
Storing output from each iteration of for loop of a structured data
Use indexing, <https://de.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html> I haven't paid much a...

plus de 8 ans il y a | 0

Réponse apportée
cumulative sum of some columns of matrix
You seem to want to do cumsum along the second dimension, so trivial is to use res = cumsum(yourMat,2); but this will pro...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
how to make 4 hour average for 24 hour data?
For 2016b or later, I'd strongly recommend using timetable as it saves so much time and efficient, <https://de.mathworks.com/...

plus de 8 ans il y a | 1

Réponse apportée
Output of a for loop into a vector?
You could simply use, b = cumsum(x) but if you must use a loop then, x=[1 8 3 9 0 1]; b=zeros(size(x)); for k=...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
iteration only runs once.
_...a part of the code that calls other functions until a parameter is true..._ You probably want to use while loop and then ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
how can I convert matrix to cell
c = num2cell(A) EDIT: I just realized you want to convert them to char, c = arrayfun(@num2str, A, 'uni',0)

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Hi, does anyone know how to calculate the volume of a closed mesh shape?
There's a blog post explaining the same. Find it on the below link: <https://blogs.mathworks.com/loren/2011/06/13/calculating-t...

plus de 8 ans il y a | 0

Réponse apportée
Conditional split into columns
You could use a cell array, A=[10 20 30 40 50 10 20 30 40 10 30 30 10 20 10 10 20 30]; inds = find(A==10); res = arra...

plus de 8 ans il y a | 0

Réponse apportée
Combining a variable with text to name outputs.
Use a struct or a table maybe? Here is how you could use struct <https://de.mathworks.com/help/matlab/ref/struct.html> Tria...

plus de 8 ans il y a | 0

Réponse apportée
Why do I get undefined variable in an if statement?
You create l inside if statements, so if none of the condition is fulfilled, then l goes undefined and when you try to access it...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Shifting data in time
I suppose you want to synchronize all the maximums, try this in that case, m = max(temp_data); [a b c] = find(temp_data=...

plus de 8 ans il y a | 0

Réponse apportée
Fast Element-Wise power
a=1:10000000; b=repmat(3,size(a)); tic c1=a.^b; toc tic c2=a.^3; toc tic c3=a.*a.*a; toc And...

plus de 8 ans il y a | 2

| A accepté

Charger plus