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

más de 8 años hace | 2

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 1

| aceptada

Respondida
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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 1

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

más de 8 años hace | 0

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

más de 8 años hace | 1

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 1

| aceptada

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

más de 8 años hace | 1

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

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

más de 8 años hace | 0

| aceptada

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

más de 8 años hace | 0

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

más de 8 años hace | 2

| aceptada

Cargar más