Risposto
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...

quasi 9 anni fa | 2

| accettato

Risposto
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...

quasi 9 anni fa | 0

| accettato

Risposto
how to find norm of each vector in one matric in Matlab?
sqrt(sum(A.^2,2))

quasi 9 anni fa | 1

| accettato

Risposto
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

quasi 9 anni fa | 0

Risposto
USING FOR LOOP TO PLOT SEVERAL LINES
something like this? plot(X(:),Y(:))

quasi 9 anni fa | 0

| accettato

Risposto
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{:});

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 0

Risposto
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) ...

quasi 9 anni fa | 0

| accettato

Risposto
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...

quasi 9 anni fa | 1

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

quasi 9 anni fa | 0

Risposto
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;...

quasi 9 anni fa | 1

Risposto
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...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 0

Risposto
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});

quasi 9 anni fa | 0

Risposto
Vector of values error for loop
r1_tot = linspace(0.01,0.35,25)

quasi 9 anni fa | 0

| accettato

Risposto
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...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 1

| accettato

Risposto
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/...

quasi 9 anni fa | 1

Risposto
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=...

quasi 9 anni fa | 0

| accettato

Risposto
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 ...

quasi 9 anni fa | 0

| accettato

Risposto
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)

quasi 9 anni fa | 0

| accettato

Risposto
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...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 0

| accettato

Risposto
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=...

quasi 9 anni fa | 0

Risposto
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...

quasi 9 anni fa | 2

| accettato

Carica altro