Risposto
Read files in a specific order
You can sort the output or |dir| any way you like. See below for an example. filelist=dir('NUM_*.dat'); dates=[filelist....

circa 8 anni fa | 1

Risposto
Installing matlab in ubuntu
Not all toolboxes are fully functional on every OS. You can find a full list <https://www.mathworks.com/products/availability.ht...

circa 8 anni fa | 0

Risposto
solve the intersection of the line and surface
You need to declare globals in each function you use them to enable the functionality. You should in general avoid |global| v...

circa 8 anni fa | 0

| accettato

Risposto
meanfreq Command in Matlab
With some functions, you can take a look at the underlying code with the |edit| command. You're in luck: meanfreq is such a func...

circa 8 anni fa | 1

Risposto
2 different for loops at the same time ?
You must index M. jj_= 4:5:length(A); ii_= 5:5:length(A); A = xlsread('example.xlsx'); M=zeros(numel(ii),numel(jj)...

circa 8 anni fa | 1

Risposto
Why Matlab2017b do not recognize Microsoft visual studio 2015 as compiler?
You need the visual studio 2015 professional edition according to the <https://www.mathworks.com/content/dam/mathworks/mathworks...

circa 8 anni fa | 0

| accettato

Risposto
how to get your x and y axis to skip every other tick mark?
You can set the |XTick| property of your axes: data1 = [9.3 480; 9.7 501; 9.7 540; 9.7 552; 9.9 547; 10.2 622; 10.5 655; 11...

circa 8 anni fa | 0

| accettato

Risposto
Hi, i have a problem regarding curve fitting. I have a set of data which is linear, but i want to fit a cos(k*l)^2 to this data and wants to find for which value of (k*l), for which the initial linear part of cosine curve fits my data?
You can use the code below to choose a value for l that results in the least difference between the actual data and the output d...

circa 8 anni fa | 0

| accettato

Risposto
Why Matlab only run the "else" function equation even "a" fulfils the condition in "if" function? The graph is plotted based on the equation in "else" function only no matter whether "a" is less than 198 or not.
If you are on R2018a you will see an m-lint warning that |a| is a non-scalar operator (and maybe earlier show it as well). The |...

circa 8 anni fa | 0

| accettato

Risposto
Editing multiple elements of an array in one line
The error you get for your example will probably depend the release. On R2018a, the implicit expansion tries to expand |b| to fi...

circa 8 anni fa | 1

| accettato

Risposto
Running exe file created with C++ from Matlab not working
And if you try to |cd| inside the same system call? system('cd /d C:\Users\me\Folder_Location && File_Name.exe') The |/d...

circa 8 anni fa | 0

Risposto
How to draw perpendicular/orthogonal lines?
As my code was apparently a full answer to your question, I'll repost my comment as an answer so you can accept it. origin=...

circa 8 anni fa | 1

| accettato

Risposto
how to combine different matrix dimensions into a single matrix ?
Matlab arrays must be rectangular. The concatenation you show is possible, so it should only give errors if you dimension descri...

circa 8 anni fa | 0

Risposto
Trying to convert cell to array when cells have range of values
This should do the trick. It assumes array indexing is possible. a={[1 2 3]',[1 1]',[1 2 3 4 5 6]'}; maxlen=max(cellfun(...

circa 8 anni fa | 0

| accettato

Risposto
How does OR work in an IF statement?
Because each is treated as separate test. Therefor you will need to use something like the line below. You could also use |switc...

circa 8 anni fa | 1

| accettato

Risposto
Move empty cell in a row
Does |cell2mat| work for you? I you want to keep it as a cell, you can also follow it up with |num2cell|. A={1,2,3,4,5,[],[...

circa 8 anni fa | 2

Risposto
How do I use Integration and Differentiation in GUI?
If you look carefully at the documentation, you can see that the |integral| function is for numeric integration and requires a l...

circa 8 anni fa | 0

Risposto
optimization - using fmin
If you can set a finite lower bound of |Epsilon_A_S| and a finite upper bound of |Epsilon_A_c|, you can use <https://www.mathwor...

circa 8 anni fa | 0

| accettato

Risposto
Regexp with multiple lines
The value if very variable, so you need to extract it first, before you can compose the appropriate expression: |Ethereum.*\$760...

circa 8 anni fa | 1

| accettato

Risposto
how do i write a function that take a vector and only displayes prime elements
You are very close. The only thing you need to do is use the logical vector to keep only prime elements. BTW, are you sure you a...

circa 8 anni fa | 0

Risposto
What's the difference between Instance Number and Acquisition Number tags in DICOM images?
This is not a Matlab question, but a question about DICOM standards. You can easily find the descriptions by using your favorite...

circa 8 anni fa | 3

| accettato

Risposto
Create a workspace with a given variable from multiple saved workspaces
You could use |eval| to do that, but you shouldn't. You should use indexing instead. Use a cell array or a struct. (I have ta...

circa 8 anni fa | 0

Risposto
Fake colorbar for image
As long as you're not using the colormap to show anything, you can use the method below. If you need to use the colormap, you ca...

circa 8 anni fa | 3

Risposto
How do i remove a row from a cell or table, if the digit in the last column is -1? Fx the last row in the example below should be removed. thank you
A_cell={4,7,3,5,0 ; 5,5,5,4,-1}; A_num=cell2mat(A_cell); A_num(A_num(:,end)==-1,:)=[]; A_cell=num2cell(A_num); Thi...

circa 8 anni fa | 0

| accettato

Risposto
Polyfit with odd powers only?
%set initial estimate intial_b_vals=[1 5]; x = rand(10,1);%x-values yx = rand(10,1);%measured y(x) %create fu...

circa 8 anni fa | 1

Risposto
How to get unique members of an array of handle classes?
<https://www.mathworks.com/help/matlab/release-notes.html?rntext=unique&startrelease=R14SP2&endrelease=R2018a&groupby=release&so...

circa 8 anni fa | 0

| accettato

Risposto
how to find out position of minimum element in a matrix
a=[8 2 5;2 -2 4;9 5 4] ; [r,c]=find(a==min(a(:))); This will even work if there are multiple positions where the minimum...

circa 8 anni fa | 0

| accettato

Risposto
How do i add a new column to an already created uitable in matlab Guide?
As Jan mentioned in <https://www.mathworks.com/matlabcentral/answers/398605-is-it-possible-to-add-a-new-colulmn-to-an-already-pr...

circa 8 anni fa | 0

| accettato

Risposto
How to get a desired result using regexp in matlab
Just like Stephen, I would also suggest changing your expression. exp2 = '[^()]'; str1 ='(1,2,3)'; str2='(1)'; [st...

circa 8 anni fa | 2

Risposto
Must be a string scalar or character vector.
You already read the dicom file to variable |A|, and then converted that to a double. Each loop iteration you are overwriting th...

circa 8 anni fa | 0

| accettato

Carica altro