Respondida
How to call a function within ax=gca format
This seems to be impossible. The closest I came was the code below. c = @cmu.colors; col=c('deep carrot orange');%returns this...

casi 6 años hace | 0

| aceptada

Respondida
for loop & saving tables
The easiest way is to read the excel file, append the new results and write the newly expanded cell array. Alternatively you ca...

casi 6 años hace | 0

| aceptada

Respondida
running an external program by changing input text file for every iteration in windows.
This should do the trick for you: % ------ open files and read the data in an array -------------- clc; clear; fid = fopen('i...

casi 6 años hace | 1

| aceptada

Respondida
All the combinations of sums of rows of matrices
The order is not the same as you stated, but this will work: A=[... 1 0 2 1 2 4 1 3 0 1 3 2]; ...

casi 6 años hace | 1

Respondida
How to run multiple iterations while increasing the index?
The easiest way to do this is to standardize the bins. If you don't want that, you should probably use a cell array. for n=1...

casi 6 años hace | 0

| aceptada

Respondida
Adding cell array values across column
It looks like you can simply convert to a normal matrix (and back): A={your_cell}; A=cell2mat(A); A=sum(A,1); A=num2cell(A);...

casi 6 años hace | 1

| aceptada

Respondida
calculation of average and difference from imported data
Well, if that is the input, then this edit to your function should work: function P = damage(time,stress) a = 2.416; b = 0....

casi 6 años hace | 2

Respondida
I have a question about using table
You should use a different syntax: class(test) Your current syntax is equivalent to class('test')

casi 6 años hace | 0

| aceptada

Respondida
Is it possible to group if-end code in the same way as a for loop?
Yes, look in the preferences:

casi 6 años hace | 0

| aceptada

Respondida
How can i select all the same codes in a function at once while MATLAB only highlights them that they are same code?
Since they have no relation to the variables in other functions, you can't. It is possible if it is a function call. So a worka...

casi 6 años hace | 0

| aceptada

Respondida
Write unicode flag to text file
Matlab stores characters internally in a uint16. That means only your first character is supported: isvalidchar = double(uint16...

casi 6 años hace | 2

| aceptada

Respondida
Write a function called valid_date that takes three positive integer scalar inputs year, month, day. If these three represent a valid date, return a logical true, otherwise false. The name of the output argument is valid. If any of the inputs is not
There are two things I notice in your code: You don't test anywhere whether the input is a scalar or a vector/array. Your leap...

casi 6 años hace | 0

| aceptada

Respondida
find expression within {}
You were close: you forgot to make the expression lazy, and you forgot you included the close bracket from the sting when exclud...

casi 6 años hace | 0

| aceptada

Respondida
Compute the minimum distance between each element in a vector with another larger array
I don't think there is a way around doing some calculation for each pair. Is there a way to vectorize distance_latlon? If not, ...

casi 6 años hace | 1

| aceptada

Respondida
Are Ryzen-5 4600H processor support Matlab.
There was an issue with an instruction set not being used. This is now fixed, at least for R2020a (and a workaround solution exi...

casi 6 años hace | 0

Respondida
Finding the number of datapoints in a text file
It looks like you can look for the line with '[data]' on it, and continue until the first line that doesn't start with a digit o...

casi 6 años hace | 1

| aceptada

Respondida
Is it possible to save plotted points?
Either save the data you use to create the plot, or retrieve that data from the XData and YData properties of the line object cr...

casi 6 años hace | 0

Respondida
Problem with plotting an anonymous function
Let's first make the terms more readable: calka1 = @(X)(integral(@(x)((... x.*(-1.15517395637196e-2)... +x.^2.*5.2577...

casi 6 años hace | 1

Respondida
create a new variable that is the product of lag value of another variable and its own lag value
survival=cumprod(1-mortality);

casi 6 años hace | 1

| aceptada

Respondida
How to make a matrix has more pixels?
If you want to increase the size of the black and white parts in equal proportion, you can use the repelem function.

casi 6 años hace | 0

| aceptada

Respondida
omit for-loop per arrayfun function
I doubt arrayfun will cause the speed-up you're hoping for. It has its own overhead, so it might even be slower. Functions like ...

casi 6 años hace | 1

| aceptada

Respondida
Copy If greater than column value
Use rowfun or a loop. Your current logical statement is checking all rows at once.

casi 6 años hace | 0

| aceptada

Respondida
Compare Strings in a loop
If you know the number of interations, why not use a for loop again? for k = 1:size(data.CellA,1) %use size(___,dim) instead of...

casi 6 años hace | 0

| aceptada

Respondida
How to find the string on .txt
Use strfind to find the start of a string, then use the length of the input to generate all indices.

casi 6 años hace | 0

Respondida
Making a software / GUI that is able to save data and change itself.
The things you mention are all possible. For general advice and examples for how to create a GUI (and avoid using GUIDE), have l...

casi 6 años hace | 0

Respondida
Plot for different conditions of function
Your code is plotting scalars. If you want to see a line you should put in multiple values at the same time. for x=-30:1:30 if...

casi 6 años hace | 0

| aceptada

Respondida
How to change the Author name in my account?
Go to https://www.mathworks.com/mwaccount/profiles/edit and click the community tab. You can change your nickname there.

casi 6 años hace | 0

Respondida
How can I display boxplots and subplots in different windows?
You can provide explicit handles for most graphics calls. qqplot is one of the exceptions. How you can deal with them is shown b...

casi 6 años hace | 0

Respondida
Standalone compilation and use of GUI app
Yes. You asked Matlab to include the txt file, so it did. If you don't want to include it in the packaged app, you shouldn't add...

casi 6 años hace | 0

Cargar más