Réponse apportée
I have written a matlab code to calculate 5 parameters. I have 12 excel file. when i run the program it should read all 12 excel files one by one and the resultant 5 parameters are the average of all 12 excel files result.How to do this?
You could read your xls files using, folderInfo = dir('*.xls'); fileNames = {folderInfo.name}; for k=1:numel(fileNam...

plus de 8 ans il y a | 0

Réponse apportée
Dose any one know any wrong with this function?
You have to store your code in an m-file under the same name as your function, in your case |intonom.m|. Once you do that, on th...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Concatenate a variable number of matrices
I suppose your matrices have (in fact, they should be) consistent dimensions, so you could as well store them in ND array. d...

plus de 8 ans il y a | 0

Réponse apportée
Save sub-matrix column and row in another matrix
your_result = your_array(your_array(:,3)==your_choice_year,:); but an efficient way to store such data is to use a table. ...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
How can I calculate with distributions?
If I understand you correctly, those two are column vectors and you want to perform element-wise multiplication, right? In that ...

plus de 8 ans il y a | 0

A résolu


surrounded matrix
With a given matrix A (size m x n) create a matrix B (size m+2 x n+2) so that the matrix A is surrounded by ones: A = [1 2 ...

plus de 8 ans il y a

Réponse apportée
Counting days by month
It's better to change your char array into datetime vector dt_array = datetime(char_array,'InputFormat','dd-MMM-yyyy') an...

plus de 8 ans il y a | 0

Réponse apportée
Options to use the switch case in matlab
try this, n = 3; while(n~=1 || n~=2) n=input('Enter the choice 1. Add 2. Remove'); switch n case 1 ...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
Store data into new variable in for loop
It's not a good idea to create such dynamic variables inside loop. How about this? Data = zeros(1,n); for k = 1:n Dat...

plus de 8 ans il y a | 2

| A accepté

Réponse apportée
how to match row of two different matrix?
ind = ismember(A,B,'rows'); if (~ind) A(end+1,:)=B; end

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
If Else statement problem
The syntax is very simple, if (P1>=P1min) && (P1<=P1max) fprintf 'Machine 1 is in limits' elseif (P2>=P2min) && ...

plus de 8 ans il y a | 0

Réponse apportée
How to convert an arbitrary rational to binary digits?
dec2base(your_number,2) read the documentation here: <https://de.mathworks.com/help/matlab/ref/dec2base.html>

plus de 8 ans il y a | 0

Réponse apportée
How to convert character cells to date?
The image you have attached says it's a *table*. In that case, it's as simple as, finalCSVnew.Date = datetime(finalCSVnew.Da...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
Multidimensional array multiplication issue
It's a simple matrix multiplication, isn't it? impulse_matrix = rand(32,32); residue_matrix = rand(5021,32); mult_result...

plus de 8 ans il y a | 0

Réponse apportée
Help me. How to plot sqrt(0.5 + 0.5 cos(w))
Sampling frequency is the interval with which you sample fs = 8000; Now you use this to generate the 't' vector t = 0...

plus de 8 ans il y a | 0

Réponse apportée
How to generate random vectors from given set of values?
use randsample. <https://de.mathworks.com/help/stats/randsample.html> your_data = rand(30,1); random_indices = randsamp...

plus de 8 ans il y a | 2

Réponse apportée
How to Rearrange variables in equation
You should define them as symbolic variables before solving. syms lambda P1 eqn = (lamda == (781*P1)/250000 + 198/25) % ==...

plus de 8 ans il y a | 0

Réponse apportée
How to do xor operation?
Another method maybe, x = {'1' '1' '1' '0' '1' '1' '0' '1'}; v = {'1' '1' '0' '0' '1' '0' '1' '1'}; res = logical(zeros(...

plus de 8 ans il y a | 1

Réponse apportée
How to get 2 or more graphs in different windows?
to create a new figure window, use f = figure(your_window_number) <https://de.mathworks.com/help/matlab/ref/figure.html>...

plus de 8 ans il y a | 0

Réponse apportée
How to read specific row and column header from text file with csv format?
Why don't you just use readtable? <https://de.mathworks.com/help/matlab/ref/readtable.html> It's much more efficient and e...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
How to subtract elements in a matrix
Ok, I guess you want to subtract following column with the current column, B = circshift(A,-1,2)-A But your expected B...

plus de 8 ans il y a | 0

Réponse apportée
how to use variable from function ?
A function has inputs and outputs, for example function a =my_fun(x) a=22+x; end Here you are getting ...

plus de 8 ans il y a | 0

Réponse apportée
What would be the function to create this new table ?
Do you want to repeat the new value ten times on the second column of the new table? sumrepArray = [repmat(sumTable{1,2},10...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
Read files from a different directory in standalone applications
You need to modify your Model_A so that it asks the user to select a directory to read the files from. That way, you'll give the...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
how to plot cuboids in cuboids?
Check this FileExchange submission: <https://de.mathworks.com/matlabcentral/fileexchange/15161-plotcube>

plus de 8 ans il y a | 0

Réponse apportée
Calculating percentage differences between matrix array data
You can simply do, dummyMatrix1 = reshape(1:25,5,5); dummyMatrix2 = 10*dummyMatrix1; perCentDiff = (dummyMatrix2-dumm...

plus de 8 ans il y a | 1

Réponse apportée
How do I make a pushbutton execute a function that used to be done after user input was given?
function pushbutton_callback(src,event) [outputs] = your_function(inputs) end

plus de 8 ans il y a | 0

Réponse apportée
Help me with indexing please?
Change the part after you define xStep with the following code xp_0 = chord/2; yp_0 = 0; k = 1; wh...

plus de 8 ans il y a | 0

Réponse apportée
How to import multiple csv files into one and read it from certain folder?
You're only getting the list of files in the folder. You need to import them using csvread <https://www.mathworks.com/help/ma...

plus de 8 ans il y a | 0

Réponse apportée
How can i plot this exact graph?
What have you tried? Did you read the documentation? <https://www.mathworks.com/help/matlab/ref/colon.html> <https://www.m...

plus de 8 ans il y a | 0

Charger plus