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

mehr als 8 Jahre vor | 2

| akzeptiert

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 1

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 1

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 1

| akzeptiert

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

mehr als 8 Jahre vor | 1

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 0

| akzeptiert

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

mehr als 8 Jahre vor | 0

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

mehr als 8 Jahre vor | 2

| akzeptiert

Mehr laden