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

8 years ago | 2

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 1

| accepted

Answered
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

8 years ago | 0

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

8 years ago | 0

| accepted

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

| accepted

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

8 years ago | 1

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

8 years ago | 0

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

8 years ago | 1

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

| accepted

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 1

| accepted

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

8 years ago | 1

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

8 years ago | 0

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 0

| accepted

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

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

8 years ago | 0

| accepted

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

8 years ago | 0

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

8 years ago | 2

| accepted

Load more